{question}
How to check if node auto-restart is enabled/disabled on reboot?
{question}
{answer}
Auto-restart of nodes is achieved primarily by enabling the corresponding memsql.service through systemctl.
When not using a tarball install the service file is generated and auto-restart is enabled on host reboot. To check from every host on the cluster, we can run the following command from the host command line:
systemctl status memsql.service
If the command returns output like below, then the auto-restart is enabled on reboot,
admin@ip-10-0-0-11:~$ systemctl status memsql.service
● memsql.service - SingleStore
Loaded: loaded (/etc/systemd/system/memsql.service; enabled; vendor preset: enabled)
If the auto-restart is not enabled, the output will be like below:
admin@ip-10-0-0-11:~$ systemctl status memsql.service
Unit memsql.service could not be found.
On Tarball installs this is to be expected as the service file has not been generated or linked. The easiest way to enable auto-restart is to utilize our enable-nodes-autostart command:
sdb-admin enable-nodes-autostart --all
If the SSH user configured through Toolbox has the proper privileges on the hosts in the cluster then this will generate the appropriate service file and attempt to enable it on the all of the hosts.
An alternate way to check if the cluster node auto-restart of the memsqld process is enabled/disabled on reboot is using the below command:
sudo ls -l /etc/systemd/system/multi-user.target.wants/*.service | grep memsql
If the above command returns output like below, It means the auto-restart is enabled:
admin@ip-10-0-0-11:~$ sudo ls -l /etc/systemd/system/multi-user.target.wants/*.service | grep memsql
lrwxrwxrwx 1 root root 58 Aug 3 08:58 /etc/systemd/system/multi-user.target.wants/memsql.service -> /opt/singlestoredb-server-7.3.11-f7c82b8166/memsql.service
If the output returns nothing like below, auto-restart is disabled:
admin@ip-10-0-0-11:~$ sudo ls -l /etc/systemd/system/multi-user.target.wants/*.service | grep memsql
admin@ip-10-0-0-11:~$
Click here to learn about disabling SingleStore Node auto restart after a host reboot.
{answer}