Reputation: 1
I have a profile in WAS 8.5 with multiple servers (ex: have a profile with Profile1 and in that profile i have server1, server2, server3) I want to delete server1 out of three servers through command line. I do not want to delete profile. want to delete one server among all.
thanks in advance
Upvotes: 0
Views: 1990
Reputation: 917
You can use the below wsadmin script (with -lang jython) to do that.
#Enter the server name. eg: servername='server1'
servername=
#Enter the node name. eg: nodename='Node1'
nodename=
#get the server id.
serverid=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername)
#remove the server
AdminConfig.remove(serverid)
#save the configuration
AdminConfig.save()
Note : Ensure the JVM is stopped before running the above script.
Upvotes: 1