I manage seven Weblogic servers for development and test. I use WLST scripts to start and stop them. This works perfectly for six of the servers, but one of them will not stop when I run the script to stop it. The start script starts it but the stop script doesn't stop it.
I'm executing the same scripts for all seven servers, it's just different parameters. WLST says it successfully shut down the server, but it's lying. It also says this very quickly (it takes a few seconds for the ones it actually shuts down).
Has anyone else had this problem? Do you have any clues as to what I should be looking at?
The servers are version 9.2. My stop script looks like this:
from java.util import *
from javax.management import *
print 'starting the script ....'
argslength = len(sys.argv)
if argslength < 2 :
print '==>Insufficient arguments'
print '==>Syntax: java weblogic.WLST stop.py domain server'
exit()
else:
domain = sys.argv[1]
server = sys.argv[2]
print 'stopping server ', server, ' in domain ', domain
nmConnect(adminId, password, host, '5556', domain)
nmKill(server)
nmDisconnect()
exit()
In the real script that adminId, password and host are hard coded.
If you already resolved share your thought...
Correct me if I m wrong...
You have multiple domains on the same machine. You wish to stop all the servers by using NM.
Did you check the server which is not shutdown (lying server :)) is that enrolled by nmEnroll()?
Related
I want to start playing around with databases in Java to help with my university work however I can't get SQL Server to work properly. I've installed it using the wizard and selecting 'Basic' the installing SSMS. However when launching SSMS I get Error 26. When researching this it says to make sure that the SQL Server Browser service is running. Unfortunately this is the issue, every time I try to start the service it fails.
All the fixes I've seen about this topic have been related to servers on another machine where as I am trying to run the server on my own PC. I've tried them anyway but nothing has worked so far. The only thing I can find that might give you a clue in helping me is that in the log file it says that it failed to register the SPN.
When working on my local machine, I don't usually need SQL Server browser - but my SQL Server itself isn't set up to run automatically.
You can go to services (either via window and search for 'services', or in Windows 10 open the task manager, go to the last tab 'services'). Find the 'SQL Server' service (it helps to sort by description column) and right click -> start.
If you take note of the name (default is 'MSSQLSERVER') you can start the service (e.g., in a batch file, from command line) using sc start "MSSQLSERVER" (or whatever your server instance is called).
I have a Websphere cell with 6 nodes(1 dmgr+5 nodeagents) and 30 jvms(5 jvms on each node). I want to kill all the 30 jvms by login into dmgr node server using wsadmin.sh from /opt/WebSphere/AppServer855/profiles/dmgrprofile/bin/. Could I have a jython script to achieve this? Please help me.
Note: I do not want to kill nodeagents or dmgr.
Thanks,
Kumar.
Use AdminTask.listServers command to get the list of all application servers in a cell, or on a specific node, and then iterate the list and stop server by using AdminControl.stopServer command.
all_servers=AdminTask.listServers('[-serverType APPLICATION_SERVER ]').splitlines()
for server in all_servers:
serverName=AdminConfig.showAttribute(server, 'name')
#stop server if its running
try:
AdminControl.stopServer(serverName,'immediate')
except:
print (serverName +" is not reachable")
I run a Garry's mod server and I want to stop my server at 7AM then start it again. To safely close the server it requires me to type quit in the server console. How could I make a script that rules quit in the console then starts my start.sh file after that is done? I was looking at crontabs but they are confusing to me.
I'm not familiar with Garry's mod servers, but in general you can do the following in a cron file:
0 7 * * * quit && /path/to/start.sh
the first bit ensures that the command is run at 7AM of machine's time every day. You can use crontab guru as a simple UI that shows what the numbers and * mean on cron scheduling.
I've assumed that quit closes the piece of code running on the machine, and doesn't restart or shutdown it down.
Also make sure to use absolute paths when running scripts from cron files.
I've got a Windows 7 machine setup with vagrant/virtualBox - each morning when I try to access my development site it always a 'Unable to connect' error message in my Firefox browser.
Even though I have booted the machine using the 'vagrant up' command for some reason it only seems to be accessible via the browser once I have done the 'vagrant provision' command. This is obviously annoying as it starts doing stuff from scratch.. eg installing my mysql database again.
Can anyone provide any light into this, and why it seems to fail to connect all the time - as this provision command is only a temporary fix as i'll need to amend the DB everytime which is only feasible in the short term.
Might just be my own setup - but I noticed nginx was restarting so have to restart this each time
I am looking for some kind of framework that will allow me to do connect to multiple servers using SSH and keep the connection open, reopen it if it dies, and allow me to run commands to it and report back. For example, check disk space on all the machines right away, so I'd do results = object.run("df -h") and it returns an array with the response from all the machines (I am not looking for a monitoring system).
Anyone have any idea?
I would use Python and the Fabric framework. Lets you easily execute commands on a set of servers - like doing deployment
with Fabric you could do
from fabric import run, env
def getSpace(server):
env.host_string
run("df -h")
>>> fab getSpace("234.24.32.1")
One way to do this would be to use Python and the paramiko library. Writing the functionality that runs a given command on a specified set of servers is then a simple matter of programming.