EM GRID: How to Change DB Console Http Port

Posted by Sagar Patil

I fixed a failed 11g dbconsole installation using http://www.oracledbasupport.co.uk/standalone-11g-dbconsole-configuration But Dbconsole picked up port 5500 instead of our usual EM port 1159.

How can we change dbconsole port from 5500 to 1159?

Before proceeding take backup of these 3 files

–     /u01/app/oracle/product/11.2.0/dbhome_1/$HOST_NAME%SID%/sysman/config/emoms.properties
–    /u01/app/oracle/product/11.2.0/dbhome_1/$HOST_NAME%SID%/sysman/config/emd.properties
–    /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_$HOST_NAME/config/server.xml

-bash-3.2$ emca -reconfig ports -DBCONTROL_HTTP_PORT 1159  -SID TEST
STARTED EMCA at 27-Aug-2010 11:02:03
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:

Do you wish to continue? [yes(Y)/no(N)]: y
27-Aug-2010 11:02:10 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/TEST/emca_2010_08_27_11_02_03.log.
27-Aug-2010 11:02:10 oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) …
27-Aug-2010 11:02:33 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) …
27-Aug-2010 11:02:58 oracle.sysman.emcp.EMDBPostConfig performReconfiguration
INFO: Database Control started successfully
27-Aug-2010 11:02:58 oracle.sysman.emcp.EMDBPostConfig performReconfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://dbserver1.dbdmz.net:1159/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at 27-Aug-2010 11:02:58

$ emca –help

-config dbcontrol db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure Database Control for a database
-config centralAgent (db | asm) [-cluster] [-silent] [parameters]: configure central agent management
-config all db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure both Database Control and central agent management

-deconfig dbcontrol db [-repos drop] [-cluster] [-silent] [parameters]: de-configure Database Control
-deconfig centralAgent (db | asm) [-cluster] [ -silent] [parameters]: de-configure central agent management
-deconfig all db [-repos drop] [-cluster] [-silent] [parameters]: de-configure both Database Control and central agent management

-addNode (db | asm) [-silent] [parameters]: configure EM for a newly added node for a database

-deleteNode (db | asm) [-silent] [parameters]: de-configure EM for for a database on node getting deleted

-addInst (db | asm) [-silent] [parameters]: configure EM for a new RAC instance
-deleteInst (db | asm) [-silent] [parameters]: de-configure EM for a specified RAC instance

-reconfig ports [-cluster] [parameters]: explicitly reassign Database Control ports
-reconfig dbcontrol -cluster [-silent] [parameters]: reconfigures RAC Database Control deployment

-displayConfig dbcontrol -cluster [-silent] [parameters]: displays information about the RAC Database Control configuration

-migrate -from dbcontrol -to centralAgent  [-repos drop] [-cluster] [-silent] [parameters]: migrates EM configuration from Database Control to central agent

-upgrade (db | asm | db_asm) [-cluster] [-silent] [parameters]: upgrades an earlier version of the EM configuration to the current version

-updateTargets crs [-silent] [parameters]: updates new crs home for all dbcontrol and central agents on crs upgrade

-restore (db | asm | db_asm) [-cluster] [-silent] [parameters]: restores the current version of the EM configuration to an earlier version

Parameters and Options:
[parameters]: [ -respFile fileName ] [ -paramName paramValue ]*
db: perform configuration operation for a database (including databases that use ASM)
asm: perform configuration operation for an ASM-only instance
db_asm: perform upgrade/restore operation for a database and an ASM instance
-repos create: create a new Database Control repository
-repos drop: drop the current Database Control repository
-repos recreate: drop the current Database Control repository and recreate a new one
-cluster: perform configuration operation for a RAC database
-silent: perform configuration operation without prompting for parameters
-backup: configure automatic backup for a database

Parameters for single instance databases
ORACLE_HOSTNAME: Local hostname
SID: Database SID
PORT: Listener port number
ORACLE_HOME: Database ORACLE_HOME
LISTENER_OH: Listener ORACLE_HOME
HOST_USER: Host username for automatic backup
HOST_USER_PWD: Host user password for automatic backup
BACKUP_SCHEDULE: Automatic backup schedule (HH:MM)
EMAIL_ADDRESS: Email address for notifications
MAIL_SERVER_NAME: Outgoing Mail (SMTP) server for notifications
ASM_OH: ASM ORACLE_HOME
ASM_SID: ASM SID
ASM_PORT: ASM port
ASM_USER_ROLE: ASM user role
ASM_USER_NAME: ASM username
ASM_USER_PWD: ASM user password
SRC_OH: ORACLE_HOME for the database to be upgraded
DBSNMP_PWD: Password for DBSNMP user
SYSMAN_PWD: Password for SYSMAN user
SYS_PWD: Password for SYS user
DBCONTROL_HTTP_PORT: Database Control HTTP port
AGENT_PORT: EM agent port
RMI_PORT: RMI port for Database Control
JMS_PORT: JMS port for Database Control
EM_SWLIB_STAGE_LOC:  Software library location
PORTS_FILE: Path to a static file specifying the ports to use (Default value : ${ORACLE_HOME}/install/staticports.ini).

Additional Parameters for cluster databases
CLUSTER_NAME: Cluster name
DB_UNIQUE_NAME: Database unique name
SERVICE_NAME: Service name
EM_NODE: Database Control node name
EM_NODE_LIST: Agent Node list [comma separated]

Note: For Desktop Class Install always pass parameter ORACLE_HOSTNAME
as “localhost” to any emca command

Standalone 11g dbconsole Configuration

Posted by Sagar Patil

I installed Oracle 11g today on RHEL 5.4 but dbconsole failed to startup. Here is a process to fix this issue.

Create   emca.rsp response file with following entries

ORACLE_HOSTNAME=dbserver1.dbdmz.oracledbasupport.net
SID=%TEST%
PORT=1521
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
LISTENER_OH=/u01/app/oracle/product/11.2.0/dbhome_1
DBSNMP_PWD=manager
SYSMAN_PWD=manager
SYS_PWD=manager

Now run emca with following options

-bash-3.2$ ./emca -config dbcontrol db -silent -respfile emca.rsp

STARTED EMCA at 27-Aug-2010 09:34:29
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

27-Aug-2010 09:34:30 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PRMUDST/emca_2010_08_27_09_34_29.log.
27-Aug-2010 09:34:33 oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) …
27-Aug-2010 09:35:47 oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
27-Aug-2010 09:35:51 oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
27-Aug-2010 09:35:51 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives …
27-Aug-2010 09:36:44 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
27-Aug-2010 09:36:44 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) …
27-Aug-2010 09:37:09 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
27-Aug-2010 09:37:09 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) …
27-Aug-2010 09:37:39 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
27-Aug-2010 09:37:39 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://dbserver1.dbdmz.oracledbasupport.net:5500/em <<<<<<<<<<<
27-Aug-2010 09:37:45 oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/dbhome_1/dbserver1.dbdmz.oracledbasupport.net_PRMUDST/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at 27-Aug-2010 09:37:45

See if EM is responding

-bash-3.2$ wget https://dbserver1.dbdmz.oracledbasupport.net:5500/em
–2010-08-27 09:39:09–  https://dbserver1.dbdmz.oracledbasupport.net:5500/em
Resolving dbserver1.dbdmz.oracledbasupport.net… 172.30.10.39
Connecting to dbserver1.dbdmz.oracledbasupport.net|172.30.10.39|:5500… connected.
ERROR: cannot verify dbserver1.dbdmz.oracledbasupport.net’s certificate, issued by `/DC=com/C=US/ST=CA/L=EnterpriseManager on dbserver1.dbdmz.oracledbasupport.net/O=EnterpriseManager on dbserver1.dbdmz.oracledbasupport.net/OU=EnterpriseManager on dbserver1.dbdmz.oracledbasupport.net/CN=dbserver1.dbdmz.oracledbasupport.net/emailAddress=EnterpriseManager@dbserver1.dbdmz.oracledbasupport.net’:
Self-signed certificate encountered.
To connect to dbserver1.dbdmz.oracledbasupport.net insecurely, use `–no-check-certificate’.
Unable to establish SSL connection.

set bash prompt

Posted by Sagar Patil

I need to remind myself on what machine & directory I am working on constantly. The easiest way to do so would be setting PS1 prompt under bash shell.

For example,
Name of Server : Server1
Pwd : /opt/IBM/WebSphere/AppServer/profiles/Profile01/Node
TAG : [Dev] Uatf]

export TAG=Dev/Uatf/Test

export PS1=‘${HOSTNAME:0:10}-$(echo $PWD|awk “{print substr(\\$1,length(\\$1)-24,25)}”)-${TAG:0:4}# ‘

returned  Server1-/logs/uatf_server_member1-Dev#

To Display HOSTNAME In caps do

export PS1=’$(echo ${HOSTNAME:0:10}|tr “[a-z]” “[A-Z]”)-$(echo $PWD|awk “{print substr(\\$1,length(\\$1)-24,25)}”)-${TAG:0:4}# ‘

returned SERVER1-/logs/uatf_server_member1-Dev#

Websphere : Change application server ports

Posted by Sagar Patil

I have set of JVM ports (9080,9081) accessible thru firewall.  This week when I built new websphere clustered ND environment something went wrong and it picked up ports 9081,9082 instead of usual 9080,9081. Here is a process I used to alter them from 9081->9080 & 9082->9081

Login at deployment manager -> Sselect Servers -> Application Servers -> Server1 -> Scroll down at right  hand pane until Communications and select “Ports”


Click on Details and edit both port numbers 9081/9444


Finally generate and propagate plugin to reflect new port changes at IBM Http server “plugin-cfg.xml”

Old Plugin-cfg.xml Settings :

<ServerCluster CloneSeparatorChange=”false” GetDWLMTable=”false” IgnoreAffinityRequests=”true” LoadBalance=”Round Robin” Name=”cluster” PostBufferSize=”64″ PostSizeLimit=”-1″ RemoveSpecialHeaders=”true” RetryInterval=”60″>
<Server CloneID=”15a4r5p9p” ConnectTimeout=”0″ ExtendedHandshake=”false” LoadBalanceWeight=”2″ MaxConnections=”-1″ Name=”Server1_Node01_server_member1″ ServerIOTimeout=”0″ WaitForContinue=”false”>
<Transport Hostname=”Server1″ Port=”9081” Protocol=”http”/>
<Transport Hostname=”Server1″ Port=”9444” Protocol=”https”>
<Property Name=”keyring” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.kdb”/>
<Property Name=”stashfile” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.sth”/>
</Transport>
</Server>

Open /opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-cfg.xml and make sure you see the new port changes

<ServerCluster CloneSeparatorChange=”false” GetDWLMTable=”false” IgnoreAffinityRequests=”true” LoadBalance=”Round Robin” Name=”cluster” PostBufferSize=”64″ PostSizeLimit=”-1″ RemoveSpecialHeaders=”true” RetryInterval=”60″>
<Server CloneID=”15a4r5p9p” ConnectTimeout=”0″ ExtendedHandshake=”false” LoadBalanceWeight=”2″ MaxConnections=”-1″ Name=”Server1_Node01_server_member1″ ServerIOTimeout=”0″ WaitForContinue=”false”>
<Transport Hostname=”Server1″ Port=”9080” Protocol=”http”/>
<Transport Hostname=”Server1″ Port=”9443” Protocol=”https”>
<Property Name=”keyring” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.kdb”/>
<Property Name=”stashfile” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.sth”/>
</Transport>
</Server>

Protected: GSK_ERROR_BAD_CERT error configuring SSL between Plug-in and Application Server V6.1

Posted by Sagar Patil

This content is password protected. To view it please enter your password below:

Wsadmin Details

Posted by Sagar Patil

To administer the WebSphere Application Server environment, wsadmin includes some specialized administrative objects.

Object Name Description

AdminConfig Object used to view and manipulate configuration elements (xml files).
AdminControl Object used to view and manipulate active application server objects (MBeans)
AdminApp Object used to install and manipulate applications.
AdminTask Object used to execute administrative and server management commands.
Help Object used to provide usage information about the administrative objects.

1. AdminConfig Overview  : Looking at the AdminConfig.help() text, you see that this object can be used to perform several operations on WebSphere Application Server configuration objects. These operations include  the following:
• List
• Create
• Remove
• Display
• Modify

AdminConfig methods:
list()
getid()
getObjectName()
showAttribute()
AdminControl methods:
getAttribute()
getCell()

2. AdminControl Overview  : The AdminControl methods here are grouped together to help you understand their respective roles

The AdminControl Object
getNode()
completeObjectName()
startServer()
stopServer()

3. AdminApp Overview  : The AdminApp object operates on applications. AdminApp.help() provides the complete list of method calls, and the details about each method can be displayed by calling AdminApp.help(‘methodName’ ).

The following types of operations can be performed on an application:
– Information
– Install
-Uninstall
– Modify

$WAS_HOME/Dmgr/bin/wsadmin.sh -conntype none -lang jython

Find out more info on an erorr message WASX7023E

wsadmin>print Help.message(‘WASX7023E’)
Explanation: An error was reported from the connector when trying to establish a connection to the host.
User action: Examine the accompanying exception information and the information in the wsadmin.traceout file to determine the cause of the error.

Locate configured ports for a system

wsadmin>print AdminTask.reportConfiguredPorts()
Ports configured in cell server1_Cell
Node server1_Manager / Server dmgr
Server1:7277 CELL_DISCOVERY_ADDRESS
Server1:9809 BOOTSTRAP_ADDRESS
Server1:8879 SOAP_CONNECTOR_ADDRESS
*:9060 WC_adminhost
*:9352 DCS_UNICAST_ADDRESS
*:9043 WC_adminhost_secure

List Server ports used by WAS, please replace Dmgr with Node Names

wsadmin>print AdminTask.listServerPorts(‘Dmgr’);
[CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS [ [port 9403] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[WC_adminhost [ [port 9060] [node localhost_Manager] [host *] [server Dmgr] ]]
[DCS_UNICAST_ADDRESS [ [port 9352] [node localhost_Manager] [host *] [server Dmgr] ]]
[BOOTSTRAP_ADDRESS [ [port 9809] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[SAS_SSL_SERVERAUTH_LISTENER_ADDRESS [ [port 9401] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[SOAP_CONNECTOR_ADDRESS [ [port 8879] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[CELL_DISCOVERY_ADDRESS [ [port 7277] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[ORB_LISTENER_ADDRESS [ [port 9100] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS [ [port 9402] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[WC_adminhost_secure [ [port 9043] [node localhost_Manager] [host *] [server Dmgr] ]]

Check if the current configuration is correct

wsadmin>print AdminTask.reportConfigInconsistencies();
Configuration consistency report for cell server1_Cell
No consistency problems were found.

Print Server Configuration

wsadmin>print AdminConfig.list(‘Server’);
Dmgr(cells/localhost_Cell/nodes/localhost_Manager/servers/Dmgr|server.xml#Server_1)
ihs-localhost(cells/localhost_Cell/nodes/localhost_Node01/servers/ihs-localhost|server.xml#Server_1264773909852)
nodeagent(cells/localhost_Cell/nodes/localhost_Node01/servers/nodeagent|server.xml#Server_1120677326772)
server_member1(cells/localhost_Cell/nodes/localhost_Node01/servers/server_member1|server.xml#Server_1265379120807)
server_member2(cells/localhost_Cell/nodes/localhost_Node01/servers/server_member2|server.xml#Server_1265379122341)

Disable Application Security

[was61@bin]$ ./opt/IBM/WebSphere/AppServer/profiles/Profile01/Dmgr/bin/wsadmin.sh -conntype NONE

wsadmin>AdminTask.isAppSecurityEnabled();
‘true’
wsadmin>securityoff();

LOCAL OS security is off now but you need to restart server1 to make it affected.
wsadmin> $AdminConfig save;

WebSphere Version

wsadmin>svr = AdminControl.queryNames( ‘type=Server,*’ )

wsadmin>print AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )
WASX7015E: Exception running command: “AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )”; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String “WebSphere:name=dmgr,process=dmgr,platform=proxy,node=Server1_Manager,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/Server1_Cell/nodes/Server1_Manager/servers/dmgr/server.xml#Server_1,cell=Server1_Cell,spec=1.0,processType=DeploymentManager
WebSphere:name=nodeagent,process=nodeagent,platform=proxy,node=Server1_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/Server1_Cell/nodes/Server1_Node01/servers/nodeagent/server.xml#Server_1120677326772,cell=Server1_Cell,spec=1.0,processType=NodeAgent

wsadmin>print AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )
WASX7015E: Exception running command: “AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )”; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String “WebSphere:name=dmgr,process=dmgr,platform=proxy,node=eugbbopg03lt_Manager,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg0               3lt_Cell/nodes/eugbbopg03lt_Manager/servers/dmgr/server.xml#Server_1,cell=eugbbopg03lt_Cell,spec=1.0,processType=DeploymentManager
WebSphere:name=nodeagent,process=nodeagent,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/nodeagent/server.xml#Ser               ver_1120677326772,cell=eugbbopg03lt_Cell,spec=1.0,processType=NodeAgent
WebSphere:name=server_member1,process=server_member1,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/se               rver_member1/server.xml#Server_1259674425316,cell=eugbbopg03lt_Cell,spec=1.0,processType=ManagedProcess
WebSphere:name=server_member2,process=server_member2,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/se               rver_member2/server.xml#Server_1259674426040,cell=eugbbopg03lt_Cell,spec=1.0,processType=ManagedProcess”; cannot create ObjectName.

Websphere : How to change HOSTNAME using ws_ant scripts

Posted by Sagar Patil

Today I have a new_server which I need to build to my websphere old_server.  The first thing to do is rename Hostname from old_server to new_server. Here is a script I used  to just do that.

Download “Configuration management scripts for V6 ConfigScripts.zip” from  http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html

Sample exportImport.xml attached here http://www.oracledbasupport.co.uk/wp-content/uploads/2010/08/exportImport.xml

[websphere@new_server config_management]$ /opt/IBM/WebSphere/AppServer/bin/ws_ant.sh -profileName dmgr -buildfile exportImport.xml -DstartManager=yes -DoldHostName=old_server -DnewHostName=new_server change  HostName
Buildfile: exportImport.xml

checkRelease:
[wsadmin] WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
[wsadmin] Executing ValidateRelease.jacl script
[wsadmin] List of Node is new_server_Manager(cells/old_server_Cell/nodes/old_server_Manager|node.xml#Node_1)
[wsadmin] old_server_Node01(cells/old_server_Cell/nodes/old_server_Node01|node.xml#Node_1)

checkNewHost:
checkOldHost:

changeHostName:
[echo] Was Home is /opt/IBM/WebSphere/AppServer
[echo] User Install Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr
[echo] Config Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/config
[echo] Cell name is old_server_Cell
[echo] Node name is old_server_Manager

changeServerIndexConfig:
[echo] Modifying serverindex.xml from old_server to new_server

changeHNServerConfig:
[echo] Modifying server.xml from old_server to new_server

changeWsadminProp:
[echo] Modifying wsadmin.properties from old_server to new_server

startManager:

doStartManager:
[exec] ADMU0116I: Tool information is being logged in file
[exec]            /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/logs/dmgr/startServer.log
[exec] ADMU0128I: Starting tool with the dmgr profile
[exec] ADMU3100I: Reading configuration for server: dmgr
[exec] ADMU3200I: Server launched. Waiting for initialization status.
[exec] ADMU3000I: Server dmgr open for e-business; process id is 22554

BUILD SUCCESSFUL
Total time: 28 seconds
[websphere@new_server config_management]$ ps -ef | grep java

Now let’s connect to the new DMGR using URL  https://new_node:9043/ibm/console/ . I could connect successfully with username /pwd as of old_server

Websphere : Jython script to return performance matrix details of Node

Posted by Sagar Patil

Here is a Jython script to return performance matrix detail of a node for following details :
Free and used JVM heap size,
Free and used Thread pools,
Free and used JDBC connection pools
Free and used Live sessions

[was61@Server1 .scripts]$ wsadmin.sh -f check_was.py -i heapsize -s  Server_member1

WASX7209I: Connected to process “dmgr” on node Server1_Manager using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: “[-i, heapsize, -s, Server_member1]”
heapsize: node=Server1_Node01  server=Server_member1  used=1024.0 MB (52.44%)  free=928.6 MB

Download script from http://www.oracledbasupport.co.uk/wp-content/uploads/2010/08/Check-was Python Script.txt

The Jython script used is as below :

#———————————————————————-
# File Name: check_was.py
#   Purpose: Display user requested information about
#            WebSphere Application Server (WSAS) resources.
#
# Run “$WAS_HOME/Dmgr/bin/wsadmin.sh -conntype none -lang jython”
# wsadmin>print AdminConfig.list(‘Server’);
# dmgr(cells/Server1_Cell/nodes/Server1_Manager/servers/dmgr|server.xml#Server_1)
# ihs-prpc(cells/Server1_Cell/nodes/Server1_Node01/servers/ihs-prpc|server.xml#Server_1280149489851)
# server_member1(cells/Server1_Cell/nodes/Server1_Node01/servers/server_member1|server.xml#Server_1280159031517)
# server_member2(cells/Server1_Cell/nodes/Server1_Node01/servers/server_member2|server.xml#Server_1280159031764)
# nodeagent(cells/Server1_Cell/nodes/Server1_Node01/servers/nodeagent|server.xml#Server_1120677326772)
#
#———————————————————————-
”’Command: %(cmdName)s\n
Purpose: wsadmin script used to display user specified information about
WebSphere Application Server resources.\n
Usage: %(cmdName)s [options]\n
Required switches/options:
-i | –info       <value> = Type of information being requested
-s | –serverName <value> = Target serverName\n
Optional switches/options:
-n | –nodeName   <value> = Target nodeName\n
Information types/values:
connectionpool – Display Connection Pool details
heapsize       – Display Heap Size details
threadpool     – Display Thread Pool details
sessions       – Display Session Details\n
\nNotes:
– Long form option values may be separated/delimited from their associated
identifier using either a space, or an equal sign (‘=’).\n
– Short form option values may be sepearated from their associated letter
using an optional space.\n
– Text containing blanks must be enclosed in double quotes.\n
Examples:
wsadmin -f %(cmdName)s.py -i heapeize -s server1 -n node01\n”’

import os, re, sys, getopt;

__scriptName__ = ‘check_was’;
__version__    = ‘0.1’;
__updated__    = ’22 July 2010′;

#———————————————————————
# Name: localMode()
# Role: Return true (1) if AdminControl object is unavailable, false
#       (0) otherwise.
# Note: In localmode (i.e., -conntype none), this returns true (1)
#———————————————————————
def localMode() :
‘localMode() – Return true (1) if AdminControl object is unavailable, false (0) otherwise’
try :
host   = AdminControl.getCell();
result = 0;                        # No, we’re connected
except :
result = 1;                        # Yes, –contype none
return result;

#———————————————————————
# Name: beanNameAsDict()
# Role: Parse the specified MBean and return a dictionary of the name
#       value pairs
#———————————————————————
def beanNameAsDict( bean ) :
‘beanNameAsDict() – Parse the specified MBean and return a dictionary of the name value pairs’
result = {};
for pair in bean.split( ‘:’, 1 )[ 1 ].split( ‘,’ ) :
n, v = pair.split( ‘=’, 1 );
result[ n ] = v;
return result;

#———————————————————————
# Name: callerName
# Role: Utility routine used to determine, and return the name of the
#       calling function.
# Note: Dependends on sys._getframe()
#  See: http://code.activestate.com/recipes/66062/
#———————————————————————
def callerName() :
“callerName() – Returns the name of the calling routine (or ‘?’)”
return sys._getframe( 1 ).f_code.co_name;

#———————————————————————
# Name: configurable()
# Role: Return true (1) if AdminConfig object is available, false (0) otherwise
#———————————————————————
def configurable() :
‘configurable() – Return true (1) if AdminConfig object is available, false (0) otherwise’
try :
host   = AdminConfig.list( ‘Server’ );
result = 1;                        # True  = AdminConfig object is available
except :
result = 0;                        # False = AdminConfig object not available
return result;

#———————————————————————
# Name: configIdAsDict
# Role: Parse a config ID and return a dictionary of name/value pairs
# Note: Exception handler requires sys module
#       The keys in the returned dictionary come from the configID, so
#       are unlikely to match your defect expectations about exactly
#       what values are used (e.g., ‘nodes’ instead of “Node”)
#———————————————————————
def configIdAsDict( configId ) :
‘configIdAsDict( configId ) – Given a configID, return a dictionary of the name/value components.’
funName = callerName();              # Name of this function
result  = {};                        # Result is a dictionary
hier    = [];                        # Initialize to simplifiy checks
try :                                # Be prepared for an error
#—————————————————————–
# Does the specified configID match our RegExp pattern?
# Note: mo == Match Object, if mo != None, a match was found
#—————————————————————–
if ( configId[ 0 ] == ‘”‘ ) and ( configId[ -1 ] == ‘”‘ ) and ( configId.count( ‘”‘ ) == 2 ) :
configId = configId[ 1:-1 ];
mo = re.compile( r’^([\w ]+)\(([^|]+)\|[^)]+\)$’ ).match( configId );
if mo :
Name = mo.group( 1 );
hier = mo.group( 2 ).split( ‘/’ );
if mo and ( len( hier ) % 2 == 0 ) :
#—————————————————————
# hier == Extracted config hierarchy string
#—————————————————————
for i in range( 0, len( hier ), 2 ) :
( name, value ) = hier[ i ], hier[ i + 1 ];
result[ name ]  = value;
if result.has_key( ‘Name’ ) :
print ”’%s: Unexpected situation – “Name” attribute conflict,
Name = “%s”, Name prefix ignored: “%s””’ % ( funName, result[ ‘Name’ ], Name );
else :
result[ ‘Name’ ] = Name;
else :
print ”’%(funName)s:
Warning: The specified configId doesn\’t match the expected pattern,
and is ignored.
configId: “%(configId)s””’ % locals();
except :
( kind, value ) = sys.exc_info()[ :2 ];
print ”’%(funName)s: Unexpected exception.\n
Exception  type: %(kind)s
Exception value: %(value)s”’ % locals();
return result;

#———————————————————————
# Name: heapsize()
# Role: Display information about the heap for the specified server
#———————————————————————
def heapsize( configID ) :
‘heapsize() – Display used and free stats for the JVM of the specified server’
cDict = configIdAsDict( configID );
jvm   = AdminControl.queryNames( ‘type=JVM,process=%(servers)s,node=%(nodes)s,*’ % cDict );
if jvm :
used    = AdminControl.getAttribute( jvm, ‘heapSize’ );
free    = AdminControl.getAttribute( jvm, ‘freeMemory’ );
total   = int( used ) + int( free );
percent = float( used ) * 100.0 / float( total );
print ‘heapsize: node=%s  server=%s  used=%.1f MB (%.2f%%)  free=%.1f MB’ % ( cDict[ ‘nodes’ ], cDict[ ‘servers’ ], MB( used ), percent, MB( free ) );
else :
print ‘Specified server does not appear to be active: node=%(nodes)s  server=%(servers)s’ % cDict;

#———————————————————————
# Name: localMode()
# Role: Return true (1) if AdminControl object is unavailable, false
#       (0) otherwise.
# Note: In localmode (i.e., -conntype none), this returns true (1)
#———————————————————————
def localMode() :
‘localMode() – Return true (1) if AdminControl object is unavailable, false (0) otherwise’
try :
host   = AdminControl.getCell();
result = 0;                        # No, we’re connected
except :
result = 1;                        # Yes, –contype none
return result;

#———————————————————————
# Name: main()
# Role: Perform the actual work of the script
#———————————————————————
def main( cmdName = None ) :
missingParms = ‘%(cmdName)s: Insufficient parameters provided.\n’;
ambigServer  = ‘%(cmdName)s: Ambiguous server specified: %(serverName)s\n’;
badReqdParam = ‘%(cmdName)s: Invalid required parameter: %(key)s\n’;
badInfo      = ‘%(cmdName)s: As yet unimplemented “info” request: %(info)s\n’;
badNode      = ‘%(cmdName)s: Unknown node: %(nodeName)s\n’;
badServer    = ‘%(cmdName)s: Unknown server: %(serverName)s\n’;
serverReqd   = ‘%(cmdName)s: Missing required parameter: “serverName”.\n’;

if not cmdName :
cmdName = __scriptName__;

#——————————————————————-
# How many user command line parameters were specified?
#——————————————————————-
argc = len( sys.argv );                   # Number of arguments
if ( argc < 2 ) :                         # If too few are present,
print missingParms % locals();          #   tell the user, and
Usage( cmdName );                       #   provide the Usage info
else :                                    # otherwise
Opts = parseOpts( cmdName );            #   parse the command line

#——————————————————————-
# Assign values from the user Options dictionary, to make value
# access simplier, and easier.  For example, instead of using:
#   Opts[ ‘nodeName’ ]
# we will be able to simply use:
#   nodeName
# to access the value.
#——————————————————————-
for key in Opts.keys() :
val = Opts[ key ];
cmd = ‘%s=Opts[“%s”]’ % ( key, key );
#   print cmd;
exec( cmd );

#——————————————————————-
# Check required parameters
#——————————————————————-
if info not in [ ‘heapsize’, ‘sessions’, ‘connectionpool’, ‘threadpool’ ] :
print badInfo % locals();
Usage( cmdName );

if not serverName :
print serverReqd % locals();
Usage( cmdName );

#——————————————————————-
# Was the nodeName specified, and if so, does it exist?
#——————————————————————-
node = None;
if nodeName :
for nid in AdminConfig.list( ‘Node’ ).splitlines() :
if nid.startswith( nodeName + ‘(‘ ) :
node = nid;
if not node :
print badNode % locals();

#——————————————————————-
# Does the specified serverName exist (within the scope of the
# specified node)?
# Note: A scope of None is identical to not specifying a scope
#——————————————————————-
servers = [];
for sid in AdminConfig.list( ‘Server’, node ).splitlines() :
if sid.startswith( serverName + ‘(‘ ) :
servers.append( sid );
if len( servers ) < 1 :
print badServer % locals();
sys.exit();
elif len( servers ) > 1 :
print ambigServer % locals();
nodes = [];
for sid in servers :
nodes.append( configIdAsDict( sid )[ ‘nodes’ ] );
print ‘Specify one of the following nodes using the –nodeName option: ‘ + ( ‘, ‘.join( nodes ) );
sys.exit();
server = servers[ 0 ];

# print ‘Request for %s on %s’ % ( info, server );
if info == ‘heapsize’ :
heapsize( server );
else :
print ‘Not yet implemented: “%s”‘ % info

#———————————————————————
# Name: MB()
# Role: Convert the specified (integer) value [bytes] into MegaBytes
#———————————————————————
def MB( val ) :
‘MB() – Convert specified integer (byte) value into MegaBytes’
return int( val ) / ( 1024.0 * 1024.0 );

#———————————————————————
# Name: parseOpts()
# Role: Process the user specified (command line) options
#———————————————————————
def parseOpts( cmdName ) :
shortForm = ‘i:n:s:’;
longForm  = ‘info=,nodeName=,serverName=’.split( ‘,’ );
badOpt    = ‘%(cmdName)s: Unknown/unrecognized parameter%(plural)s: %(argStr)s\n’;
optErr    = ‘%(cmdName)s: Error encountered processing: %(argStr)s\n’;
problem   = ‘%(cmdName)s: Error option processing problem: %(opt)s\n’;

try :
opts, args = getopt.getopt( sys.argv, shortForm, longForm );
except getopt.GetoptError :
argStr = ‘ ‘.join( sys.argv );
print optErr % locals();
Usage( cmdName );

#——————————————————————-
# Initialize the Opts dictionary using the longForm key identifiers
#——————————————————————-
Opts = {};
for name in longForm :
if name[ -1 ] == ‘=’ :
name = name[ :-1 ]
Opts[ name ] = None;

#——————————————————————-
# Process the list of options returned by getopt()
#——————————————————————-
for opt, val in opts :
if opt in   ( ‘-i’, ‘–info’ )       : Opts[ ‘info’       ] = val
elif opt in ( ‘-n’, ‘–nodeName’ )   : Opts[ ‘nodeName’   ] = val
elif opt in ( ‘-s’, ‘–serverName’ ) : Opts[ ‘serverName’ ] = val
else :
print problem % locals();

#——————————————————————-
# Check for unhandled/unrecognized options
#——————————————————————-
if ( args != [] ) :        # If any unhandled parms exist => error
argStr = ‘ ‘.join( args );
plural = ”;
if ( len( args ) > 1 ) : plural = ‘s’;
print badOpt % locals();
Usage( cmdName );

#——————————————————————-
# Return a dictionary of the user specified command line options
#——————————————————————-
return Opts;

#———————————————————————
# Name: Usage()
# Role: Display usage information necessary to use this script.
#———————————————————————
def Usage( cmdName = None ) :
if not cmdName :
cmdName = __scriptName__;

print __doc__ % locals();       # Script docstring contains usage info
sys.exit();

#———————————————————————-
# Code execution begins
#———————————————————————-
if ( __name__ == ‘__main__’ ) or ( __name__ == ‘main’ ) :
if localMode() :
print ‘A connection to WebSphere Application Server is required.\n’;
Usage();
elif configurable() :
main();
else :
print ‘WebSphere Application Server scripting objects appear to be unavailable.\n’;
Usage();
else :
print ‘This script should be executed, not imported.\n’;
Usage( __name__ );


Time Travel & Websphere Node/Deployment manager synchronisation

Posted by Sagar Patil

I have websphere 6.x ND servers which time travel in future i.e 2011/2012.  One of machine time traveled to 2011, I then had to revert it back to current date i.e 2010. I can now see that configuration under following directories is not updated properly.

DMGR : Aug 5 2010 is the latest.

[was@Server1 Profile01]$ ls -l profiles/Profile01/dmgr/config/cells/Server1_Cell/nodes/Server1_Node01
total 136
-rw-rw-r– 1 was was   818 Aug  5 16:23 trust.p12
-rw-rw-r– 1 was was  3474 Aug  5 16:23 key.p12
-rw-rw-r– 1 was was 12552 Aug  3 13:24 serverindex.xml

[was@Server1 ~]$ ls -lrt profiles/Profile01/Node/config/cells/Server1_Cell/nodes/Server1_Node01
total 136
-rw-rw-r– 1 was was  2042 Aug 13  2011 trust.p12
-rw-rw-r– 1 was was  2770 Aug 13  2011 key.p12
-rw-rw-r– 1 was was 12552 Aug 15  2011 serverindex.xml

How does Deployment manager syncs Nodes with it’s new configuration?

In order for synchronization to work, the system clocks of the Deployment Manager, and Node Agent machines must be within a specific time range. Otherwise, the attempt to synchronize will fail, and you will get a message indicating that the time difference is too great.

If you have more than 5 min difference between dmgr and node. And you have admin security enabled. Then you will see LTPA token expiration errors…. While communicating with the Deployment Manager, the Node agent for example sync or discover process.

Where will I get this error message?

Yes.  The Deployment Manager is the one that attempts the synchronization with the node agents, so the status messages (i.e., success/failure) would be in the DM logs.

I often get too many file entries left at wstemp and temp directories under NodeAgent/Dmgr. They are failed sync files and would like to know if I can delete them.

WebSphere Application Server and config temp files

  • The node sends a sync request to cell (dmgr)
  • The cell manager identifies the modified documents, copies them to the temp folder (config/temp) and then sends the response to node with the URLs of modified documents.
  • The node then uses the File Transfer service to download the documents to local machine.
  • The file transfer service internally sets a flag that enables the file transfer server to delete the temp file once the download is complete.

Whenever there is a request to transfer a file, the dmgr creates a temp copy in the config/temp directory. <Install_Root>\config\temp\cells\<cell_name>\applications\ .

  • The dmgr deletes the temp copy only when the file is completely read and copied to the client.
  • The temp files get deleted only when the download process is complete and successful.

Why does dmgr/nodeagent use temp directories? Is there any reason for it?

The wstemp directory is where workspaces (save areas) are created when someone begins the process of changing a configuration in a node.
The wstemp directory is the workspace directory.  Any program that ask the workspace for a session (e.g. adminconsole and wsadmin)  a directory will be created.  If the session is not cleaned up
the directories will remain.  For wsadmin, the completion of wsadmin will clean the directory, note if you kill or wsadmin fails to work and crash, the folder will remain (these have script in the folder
name).

For adminconsole, each user will have their own folder. These folders will always remain because we maintain user preference during their sessions.  Also if the user does not logout, we keeps all configuration changes in this folder.  Once they log out, the user folder will be reduced to contain the minimum preference information for the next session login. You can remove all these files/folders and the dmgr will create new files (we highly recommmend stopping the dmgr before deleting these so users logged in don’t have errors).

These folders contain temporary files and can be manually deleted.  Websphere will automatically manage these files and if they are growing later, something is wrong because users are killing/not logging out.

Hers is a reference document which helps to understand and to debug the problems with wstemp workspace directories which contains workspace  directories named with ‘anonymousxxxx’ and ‘ Scriptxxxx’ .

Problem with workspace directories when created in wstemp directory
http://www-1.ibm.com/support/docview.wss?uid=swg21221297

More reading

IBM – WebSphere Application Server synchronization process explained
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21233075

IBM – What is file synchronization and how does it work?
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21108407

Top of Page

Top menu