Cluster related - Jython Script giving problem

This is a discussion on Cluster related - Jython Script giving problem within the Websphere forums, part of the Application Servers category; D:\IBM\WebSphere\AppServer\bin\wsadmin.bat -lang jython -f conf igure_server.py iscribe WASX7209I: Connected to process "dmgr" on node iscribe-dmgr01CellManager01 using SOAP connector; The type of process is: DeploymentManager WASX7303I: The following options are passed ...

Go Back   Unix Linux Forum > Application Servers > Websphere

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 02:35 PM
Default Cluster related - Jython Script giving problem

D:\IBM\WebSphere\AppServer\bin\wsadmin.bat -lang jython -f conf
igure_server.py iscribe
WASX7209I: Connected to process "dmgr" on node iscribe-dmgr01CellManager01 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: "[iscribe]"
Fri Aug 08 21:37:49 2008 |I| ? ( :32) ******************************
******************************
Fri Aug 08 21:37:49 2008 |I| ? ( :32) *
Fri Aug 08 21:37:49 2008 |I| ? ( :32) Log file open
Fri Aug 08 21:37:49 2008 |I| ? ( :32) *
Fri Aug 08 21:37:49 2008 |I| ? ( | retry (wsadmin_funcs.py:53) will invoke method com.
ibm.ws.scripting.AdminControlClient.queryNames of com.ibm.ws.scripting.AdminCont
rolClient instance at 858207015
Fri Aug 08 21:37:49 2008 |I| isDM (wsadmin_funcs.py:2098) dm bean is WebSphere:n
ame=DeploymentManager,process=dmgr,platform=common ,node=iscribe-dmgr01CellManage
r01,diagnosticProvider=true,version=6.1.0.17,type= DeploymentManager,mbeanIdentif
ier=DeploymentManager,cell=iscribe-dmgr01Cell01,spec=1.0
Fri Aug 08 21:37:49 2008 | | isDM (wsadmin_funcs.py:2100) returning 1
Fri Aug 08 21:37:49 2008 |I| ? (:161) ND detected
WASX7017E: Exception received while running file "configure_server.py"; exceptio
n information: com.ibm.websphere.management.exception.InvalidConf igDataTypeExcep
tion: ADMG0007E: The configuration data type Cluster is not valid.

This is the part of the code where it is not able to detect the cluster :

scope = AdminConfig.getid("/Cluster:%s/" % clusterName)

Can somebody suggest why it gives this error : ADMG0007E: The configuration data type Cluster is not valid
Reply With Quote
  #2  
Old 08-26-2008, 03:14 PM
Default Re: Cluster related - Jython Script giving problem

scope = AdminConfig.getid("/Cluster:%s/" % clusterName)

Here is the correct way to get the cluster id.

{code}
scope = AdminConfig.getid("/ServerCluster:clusterName/")
{code}

Anant
Reply With Quote
  #3  
Old 08-26-2008, 05:00 PM
Default Re: Cluster related - Jython Script giving problem

Hey Anant,

It is still not working, it is still giving the same error.
Reply With Quote
  #4  
Old 08-26-2008, 05:11 PM
Default Re: Cluster related - Jython Script giving problem

Hi Anant,
It progressed from there but landed up with the foll error :

WASX7017E: Exception received while running file "configure_server.py"; excepti
n information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "", line 189, in ?
AttributeError: module 'wsadmin_funcs' has no attribute 'listServersInCluster'

Even though there are 2 app servers listed in the cluster.

The piece of code is below :

slist = wsadmin_funcs.listServersInCluster(scope)
for sid in slist:
serverName = wsadmin_funcs.getObjectName(sid, "name")
nodeName = wsadmin_funcs.getServersNode(sid)
scriptlog.info ("Processing server %s on node %s" % (serverName, nodeName))
setupServerScopeResources(propfile, nodeName, serverName)

Kindly suggest
Reply With Quote
  #5  
Old 08-26-2008, 06:06 PM
Default Re: Cluster related - Jython Script giving problem

| setSessionTimeout (wsadmin_funcs.py:2037) 20 on ser
ver
WASX7017E: Exception received while running file "configure_server.py"; exceptio
n information: com.ibm.ws.scripting.ScriptingException: WASX7077E: Incomplete co
nfig id: need closing parenthesis in ""

The piece of code is mentioned below:

def setSessionTimeout (serverId, timeoutmin):
"""Sets HTTP session timeout per server"""
entry ("%d on server %s" % (timeoutmin, serverId))
wc=AdminConfig.list("WebContainer", serverId)
sm=AdminConfig.list("SessionManager", wc)
tp=AdminConfig.list("TuningParams", sm)
AdminConfig.modify (tp, [["invalidationTimeout", timeoutmin]])
exit()
kindly suggest ..
Reply With Quote
  #6  
Old 08-26-2008, 06:29 PM
Default Re: Cluster related - Jython Script giving problem

Kindly note that the last line in that code is :

AdminConfig.modify (tp, [["invalidationTimeout", timeoutmin]])
Reply With Quote
  #7  
Old 08-26-2008, 08:14 PM
Default Re: Cluster related - Jython Script giving problem

Hi Anant,

Looks like the Code is not able to analyse the different nodes since it is required for Clustering,this part of the code works perfectly well in case of Single server instance since only 1 node is there.
Kindly suggest what tweaking will be required in the code I have send so that it works for Clustering and does not send out an exception as stated above.
Reply With Quote
  #8  
Old 08-27-2008, 11:53 AM
Default Re: Cluster related - Jython Script giving problem

ok, i am not sure how you have setup your procedures, but here is the snippet to get the web container id and session manager id of the each individual cluster member in a cluster.
Change the clustername in the cId.

{code}

lineSeparator = java.lang.System.getProperty('line.separator')

cId = AdminConfig.getid("/ServerCluster:clusterName/" )
cList = AdminConfig.list("ClusterMember", cId ).split(lineSeparator)
for sId in cList:
print "sId: "+sId
cMemName = AdminConfig.showAttribute(sId, "memberName" )
cMemNodeName = AdminConfig.showAttribute(sId, "nodeName" )
cMemId = AdminConfig.getid("/Node:"+cMemNodeName+"/Server:"+cMemName+"/" )
webContProp = AdminConfig.list("WebContainer", cMemId )
webContSessMgr = AdminConfig.list("SessionManager", cMemId )

print "webContProp: "+webContProp
print "webContSessMgr: "+webContSessMgr
#endFor

{code}


Anant
Reply With Quote
  #9  
Old 08-27-2008, 01:20 PM
Default Re: Cluster related - Jython Script giving problem

Hi Anant,

I am still having issues tweaking that code since it has been done in such a manner that it is very hard to decipher.Can I send u the files which are of concern. Do let me know ur views on that.
Reply With Quote
  #10  
Old 08-27-2008, 05:15 PM
Default Re: Cluster related - Jython Script giving problem

Hi Anant,

I got the foll error now :

WASX7017E: Exception received while running file "configure_server.py"; exceptio
n information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File " ", line 184, in ?
File "", line 156, in addSSLSignerCertsFromPropfile

com.ibm.ws.scripting.ScriptingException: com.ibm.websphere.management.cmdframewo
rk.CommandException
com.ibm.websphere.management.cmdframework.CommandV alidationException: The keySto
res name NodeDefaultTrustStore and scopeName (cell):dmgr01Cell01 is not
found

I have attached the file which has the 2 functions involved but do not know why it is asking for Dmgr node when actually the certs have to be put in Cluster created eg "TESTCLUSTER".
Kindly have a look and suggest what could be the issue, I tried removing the nodename and adding the cluster name instead but still the same error.
Reply With Quote
  #11  
Old 09-02-2008, 12:33 PM
Default Re: Cluster related - Jython Script giving problem

Hi Team,

Any luck with the attached code?
Reply With Quote
  #12  
Old 09-03-2008, 06:43 PM
Default Re: Cluster related - Jython Script giving problem

Hi Anant,

Did you get a chance to look at this code and decipher why it was not directing to a cluster?
Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 11:19 PM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger