Hello,
Does anyone know why this is happening ?
I've written a jython script that should be able to start non-running AppServers simultaneously on a "per node" basis.
ie, Each node starting 1 x AppServer at a time, but independantly of of each other. This works ok if I run each command one by one via the wasadmin interface, but when I however try to run this via a script using (-f), wasadmin exits and AdminControl.startServer doesn't seem to run. I've even tried appending the wsadmin.sh -lang jython -f $SCRIPT with "&" in order to run this as a Unix background task, but to no avail. I've detailed the script below.
Thanks in advance
----------------------------------------------------------
import thread
nodes = AdminConfig.list('Node')
nodes1 = nodes.split(lineSeparator)
def func(node):
node_name = AdminConfig.showAttribute(node, 'name')
servers = AdminConfig.list('Server', node)
servers1 = servers.split(lineSeparator)
for server in servers1:
serv_name = AdminConfig.showAttribute(server, 'name')
serv_type = AdminConfig.showAttribute(server, 'serverType')
run_serv = AdminConfig.getObjectName(server)
len_run = len(run_serv)
if len_run < 1:
try:
AdminControl.startServer(serv_name, node_name)
except:
print serv_name
print node_name
print "ERROR"
else:
print serv_name
print node_name
print "OK"
for node in nodes1:
thread.start_new_thread(func, (node,))
----------------------------------------------------------
Does anyone know why this is happening ?
I've written a jython script that should be able to start non-running AppServers simultaneously on a "per node" basis.
ie, Each node starting 1 x AppServer at a time, but independantly of of each other. This works ok if I run each command one by one via the wasadmin interface, but when I however try to run this via a script using (-f), wasadmin exits and AdminControl.startServer doesn't seem to run. I've even tried appending the wsadmin.sh -lang jython -f $SCRIPT with "&" in order to run this as a Unix background task, but to no avail. I've detailed the script below.
Thanks in advance
----------------------------------------------------------
import thread
nodes = AdminConfig.list('Node')
nodes1 = nodes.split(lineSeparator)
def func(node):
node_name = AdminConfig.showAttribute(node, 'name')
servers = AdminConfig.list('Server', node)
servers1 = servers.split(lineSeparator)
for server in servers1:
serv_name = AdminConfig.showAttribute(server, 'name')
serv_type = AdminConfig.showAttribute(server, 'serverType')
run_serv = AdminConfig.getObjectName(server)
len_run = len(run_serv)
if len_run < 1:
try:
AdminControl.startServer(serv_name, node_name)
except:
print serv_name
print node_name
print "ERROR"
else:
print serv_name
print node_name
print "OK"
for node in nodes1:
thread.start_new_thread(func, (node,))
----------------------------------------------------------