When restarting the VMGR, which is WebSphere based, you should also restart the solidDB, according to this technote: http://www-01.ibm.com/support/docview.wss?uid=swg21649416
The VMGR websphere server has a startup script that you can enable to launch at boot-time just by typing in the command:
cd /etc/init.dSo, in order for me to achieve a solidDB auto-startup when the server boots, and also, making it easier for me to stop and start the solidDB server, I created this script:
chkconfig STMediaServer_was.init on
Note: The script has to be stored in the "/etc/init.d" folder.
The script file name is: "soliddb"
#!/bin/tcsh
# chkconfig: 2345 80 30
# description: SOLIDDB-service Service
# Created by @robertfarstad, http://blog.robertfarstad.com
setenv USER "admin"
setenv PASS "admin"
setenv SERVER "tcp localhost 2315"
setenv STOPARGS "stopargs.sql"
setenv PTH "/opt/solidDB/soliddb-7.0/bin/"
cd $PTH
setenv SERVICE_PID `ps aux | grep standalone | grep -v grep | awk '{print $2}'`;
echo $SERVICE_PID
if (start == $1) then
if($SERVICE_PID) then
echo "-----------> SOLIDB-server is already running";
else
echo "-----------> SOLIDDB is not running";
echo "-----------> SOLIDDB-server starting";
/opt/solidDB/soliddb-7.0/bin/solid -c /opt/solidDB/soliddb-7.0/eval_kit/standalone
echo "-----------> SolidDB started";
endif
endif
if (stop == $1) then
if ($SERVICE_PID) then
echo "------------> SOLIDDB-service stopping";
./solsql "$SERVER" $USER $PASS $STOPARGS
echo "------------> Waiting for server to stop";
sleep 1;
echo ".";
sleep 1;
echo "..";
sleep 1;
echo "...";
sleep 1;
echo "....";
sleep 1;
echo ".....";
sleep 1;
echo "......";
sleep 1;
echo ".......";
sleep 1;
echo "........";
sleep 1;
echo ".........";
sleep 1;
echo "..........";
sleep 1;
echo "...........";
echo "------------> SOLIDDB-service stopped";
else
echo "------------> SolidDB already stopped";
endif
endif
if(restart == $1) then
if($SERVICE_PID) then
echo "-------------> SOLIDB-server is already running";
echo "-------------> Stopping SOLIDDB";
./solsql "$SERVER" $USER $PASS $STOPARGS
echo "-------------> Pausing for 20 secs before restarting";
sleep 20;
echo "-------------> Starting SOLIDDB";
/opt/solidDB/soliddb-7.0/bin/solid -c /opt/solidDB/soliddb-7.0/eval_kit/standalone
echo "-------------> SolidDB started";
else
echo "-------------> SOLIDDB is not running";
echo "-------------> SOLIDDB-service is starting";
/opt/solidDB/soliddb-7.0/bin/solid -c /opt/solidDB/soliddb-7.0/eval_kit/standalone
echo "-------------> SolidDB started";
endif
endif
if (status == $1) then
if($SERVICE_PID) then
echo "-------------> SOLIDDB Server (pid $SERVICE_PID) is running...";
else
echo "-------------> SOLIDDB-Server is not running";
endif
endif
There´s a reference to a file "stopargs.sql" in this script. This file must be created and stored in the "/opt/solidDB/soliddb-7.0/bin/" directory.
The content of the file is this:
admin command 'shutdown force';After the "soliddb" script and the stopargs.sql file is created, you have to run the following commands to enable this as a service
exit;
cd /etc/init.dNow you can run the following commands in order to stop/start/restart/check status of the soliddb server:
chkconfig --add soliddb
chkconfig soliddb on
service soliddb statusAnd also, restarting the linux redhat server will autostart the SolidDB server.
service soliddb start
service soliddb stop
service soliddb status
Hope this was helpful for you guys. Cheers.
6 comments:
Thank you Robert, very helpful!
Cheers
Klaus
My pleasure, Klaus :-)
Hi Robert,
You don't really need the stopargs.sql file as you can pass a command to solsql on the command line. Like so:
solsql -e "admin command 'shutdown force'" "$SERVER" $USER $PASS
Hi there.
Thanks! Will try that one.
Thank you Robert !
It worked. :-)
Post a Comment