Skip to content

Latest commit

 

History

History
56 lines (49 loc) · 1.94 KB

OpsCenter_tarball_install_custom_start-stop_scripts.md

File metadata and controls

56 lines (49 loc) · 1.94 KB

OpsCenter Tarball Installation Custom Start/Stop Scripts

Currently Customize scripts for starting and stopping DataStax Enterprise for OpsCenter tarball installation doesn’t provide any information for customers/users to properly leverage the scripts. Something like below would be helpful to get started with.

I would start modifying the start script something like below,

I would start modifying the stop script something like below,

  • https://docs.datastax.com/en/dse/6.8/dse-admin/datastax_enterprise/operations/startStop/stopDseNode.html
    #!/bin/sh
    NODETOOL=/path/to/nodetool
    DSE_STOP="/path/to/tarball/installation/bin/dse cassandra-stop"
    #One could go fancier like DSE_STOP=kill -9 `ps -ef|grep -v grep|grep cassandra|grep dse|cut -d" " -f4`
    
    sudo $NODETOOL drain
    #add wait for couple seconds?
    RESULT=$?
    if [ $RESULT -ne 0 ]
    then
        # something went wrong with drain
        echo >&2 "ERROR - nodetool drain failed with error code [$RESULT]... attempting to stop DSE..."
    fi
    
    sudo $DSE_STOP
    RESULT=$?
    if [ $RESULT -eq 0 ]
    then
        # shutdown successful
        exit $RESULT
    else
        # something went wrong stopping DSE
        echo >&2 "ERROR - Failed to stop DSE, error code [$RESULT]"
        exit $RESULT
    fi