SQWareProduction:cassandra:bin:sqwcas RollingRestart.ksh
Contents
Presentation
Script $gvsqw_CasBin/sqwcas_RollingRestart.ksh :
Run 'stop/start/restart' cassandra on selected nodes
Online help
The online help is available for most scripts with the -h option.
Ex: $gvsqw_CasBin/sqwcas_RollingRestart.ksh -h
Content of this assistance :
Sourcing sqwcas_Global.lib v2024.01 SQWareProduction for Cassandra (dbSQWare) ... Usage: sqwcas_RollingRestart.ksh [-h] -I <instance> [+ options] DESCRIPTION sqwcas_RollingRestart.ksh Run 'stop/start/restart' cassandra on selected nodes SUPPORT Cassandra supported versions: 2.0 <= v <= 4.0 PARAMETERS -I instance : Target instance. OPTIONS -h help : Display the full usage. -s : Display samples of usage. -A action : Action (start, stop, restart : by default restart). -S scope : Scope of the execution (default: Local) Local => only on the local node LocalNode => only on the local node Node_$NodeName => only on the node '$NodeName' LocalDC => all nodes on the local datacenter DC_$DCName => all nodes on the datacenter '$DCName' All => all nodes on the cluster(all datacenters) AllNodes => all nodes on the cluster(all datacenters) AllDC => all nodes on the cluster(all datacenters) -FRT return_code : Force return code value on error. -AddMail email : Email address to add at 'pmexpdba@gmail.com'. -Timeout Nb_sec : Timeout before kill off 'nodetool drain' command when stop (by default 900). -SendReport : Send execution log report. -Dynamic : Force dynamic discovery of nodes (by default, search in $gvsqw_RootCfg/.clucfg generated by sqwcas_GenNodesConf.ksh). -NoMail : Disable sendmail on error pmexpdba@gmail.com (by default, send on error). -Locale locale : Force Locale for help display (fr,en). -Wait : Wait between two nodes restart (by default 120). -Exec : Execute commands (default, display generated commands)
Error management
Errors passing arguments
This type of message is generated:
Lack 'CAS_SID' parameter, Usage: sqwcas_RollingRestart.ksh [-h] -I <instance> [+ options] For full help : sqwcas_RollingRestart.ksh -h
If you are connecting through a terminal, no mail will be sent and you will have more this kind of message:
Not sending mail because you are in connected mode !!! Lack 'CAS_SID' parameter
If you are not connected to a terminal, the error message appears and is sent by mail to the address contained in the variable $gvsqw_GlobalMail (See help customize this variable). The subject line will always start by "$gvsqw_MailMsg_cassandra : " (See help customize this variable).
Execution errors
Whether you are or not connected to a terminal, the error message appears and an email containing a summary of treatment errors is sent to the address contained in the variable $gvsqw_Mail_cassandra (See help customize this variable). The subject line will always start by "$gvsqw_MailMsg_cassandra : " (See help customize this variable).
Usage examples
Sourcing sqwcas_Global.lib v2024.01 SQWareProduction for Cassandra (dbSQWare) ... #Standard help for script sqwcas_RollingRestart.ksh: # XXXXX : -S # XXXXX : -Timeout # XXXXX : -Wait $gvsqw_CasBin/sqwcas_RollingRestart.ksh -h #Display online help for this script $gvsqw_CasBin/sqwcas_RollingRestart.ksh -Locale en -h #Display online help for this script with forcing of the 'en' locale (default locale managed by the variable gvsqw_Locale) $gvsqw_CasBin/sqwcas_RollingRestart.ksh -s #Display usage examples for this script $gvsqw_CasBin/sqwcas_RollingRestart.ksh -AddMail 'mymail1@mydomaine.com,mymail2@mydomaine.com' #Add the mail list to the default address managed by the variable gvsqw_GlobalMail $gvsqw_CasBin/sqwcas_RollingRestart.ksh -SendReport #Send the log by email at the end of the treatment even if there is no error $gvsqw_CasBin/sqwcas_RollingRestart.ksh -I $CAS_SID -NoMail #Deactivate sendmail on error to $gvsqw_GlobalMail (by default, send on error) $gvsqw_CasBin/sqwcas_RollingRestart.ksh -A <Action> #execute action (start, stop, restart) $gvsqw_CasBin/sqwcas_RollingRestart.ksh -I $CAS_SID-FRT <NumericValue> -Exec #Force return code to '<NumericValue>' on error (if no error, exit 0!) #You can also force return code of this script on all your #environnement if you set the variable: $gvsqw_ForcedReturnCodeScript_sqwcas_RollingRestart=<NumericValue> #in configuration file $gvsqw_CasBin/../etc_cust/sqwcas_GlobalVar.cfg