autostart database

Hello, I have an installed vertica cluster with 3 hosts. I want to do autostart database when starting hosts (when all hosts were shutdown and now I turn on them). At every host in /etc/init.d/ I added script myscript.sh:
sudo -u myuser /opt/vertica/bin/admintools -t start_db -d test

When I run this script manually, it works and database is starting. But when the script is launched at OS startup, the database does not start. In the adminTools.log log I don't see startup errors, I see only pexpecting vsql command... and All nodes in db test are in state DOWN

2020-06-08 16:42:08.526 agent/752:0x7f195dffb700 [vsql._just_connect] <INFO> pexpecting vsql command: /opt/vertica/bin/vsql --no-vsqlrc -n  -p 5433 -U myuser -h 192.168.0.5 test -P pager -A
2020-06-08 16:42:08.984 agent/752:0x7f195dffb700 [vsql._just_connect] <INFO> pexpecting vsql command: /opt/vertica/bin/vsql --no-vsqlrc -n  -p 5433 -U myuser -h 192.168.0.6 test -P pager -A
2020-06-08 16:42:09.459 agent/752:0x7f195dffb700 [vsql._just_connect] <INFO> pexpecting vsql command: /opt/vertica/bin/vsql --no-vsqlrc -n  -p 5433 -U myuser -h 192.168.0.7 test -P pager -A
2020-06-08 16:43:05.639 admintools/3701:0x7f456298c740 [adminExec.getCollapsedClusterState] <INFO> All nodes in db test are in state DOWN

Why is that?

Tagged:

Answers

  • Bryan_HBryan_H Employee

    It's recommended to start from only one node rather than adding to each node. Also, it's probably best to start using systemd rather than admintools directly - there should be a script /etc/init.d/verticad installed for this, if not then check in /opt/vertica/sbin for init.d and systemd scripts.

  • I left the script in /etc/init.d/ only at one host but the problem persisted

  • Bryan_HBryan_H Employee

    If you run /etc/init.d/verticad start, does it work?
    If so, then use the command in that file, which is:
    su -l "$user" -c "${vertica_prefix}/bin/adminTools -t command_host -c $1"

  • If you run /etc/init.d/verticad start, does it work?

    No, service verticad doesn't work
    I run systemctl start verticad
    Then I run: systemctl status verticad
    verticad.service - Vertica server restart oneshot
    Loaded: loaded (/etc/systemd/system/verticad.service; enabled; vendor preset: disabled)
    Active: inactive (dead) since Thu 2020-06-11 07:19:43 MSK; 38min ago
    Process: 650 ExecStart=/opt/vertica/sbin/verticad start (code=exited, status=0/SUCCESS)
    Main PID: 650 (code=exited, status=0/SUCCESS)

        Jun 11 07:19:09 verticaserv1 systemd[1]: Starting Vertica server restart oneshot...
        Jun 11 07:19:13 verticaserv1 su[706]: (to mydba) root on none
        Jun 11 07:19:43 verticaserv1 verticad[650]: Vertica: start OK for users: mydba
        Jun 11 07:19:43 verticaserv1 verticad[650]: [  OK  ]
        Jun 11 07:19:43 verticaserv1 systemd[1]: Started Vertica server restart oneshot.
    

    In logs (/opt/vertica/log/verticad.log and /var/log/messages) I see only:
    vertica process is not running
    Vertica: start not OK

  • Bryan_HBryan_H Employee

    Two other places to check: /opt/vertica/log/admintools.log, since all startups wrap admintools, and if nothing there, or to verify what admintools logs show, check the catalog directory for "startup.log" which will show more details.
    Usually when I run into this, it means one node didn't shut down cleanly, and it is necessary to roll back failed transactions with admintools -t restart_db with additional recovery options.
    Always be sure to shut down a EE mode (local data and catalog) database before shutting down the hosts to avoid issues where Vertica has not finished commit to disk.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.