Can the data repository stop or start be scripted

Document ID : KB000093243
Last Modified Date : 09/11/2018
Show Technical Document Details
Introduction:
The CAPM docops section on how to restart the data repository (Vertica nodes) details the process which includes using the administration tool (adminTools) which is menu driven:
However, sometimes the interface or accessibility requires this be done using the command line. For example, to script this for use as part of system patching tasks.
 
Question:
Is there a way to restart the Vertica cluster via a script? 
Environment:
CAPM 3.x on linux
Answer:

There is one caveat that you need to be aware of using the command line with Vertica. Sometimes, if there is a problem starting the db, adminTools will offer some choices, like start from last good epoch. When you use the command line, those options are not seen and the db just fails.

With that in mind, here are some commands:

Replace <DBPASS> with your password, if different.

To start the DB from the root user account:

su - dradmin -c "/opt/vertica/bin/adminTools -t start_db -d drdata -p <DBPASS> -i";

To stop the DB:

su - dradmin -c "/opt/vertica/bin/adminTools -t stop_db -d drdata -p <DBPASS> -i";

To get the status of the DB:

su - dradmin -c "/opt/vertica/bin/adminTools -t view_cluster";

Additional Information:
https://my.vertica.com/docs/8.1.x/HTML/index.htm#Authoring/OEMCookbook/Packaging/StartingDB.htm?Highlight=adminTools