how to tell if vertica is ready to accept connections

upon reboot it seems to take a long time for spreadd, vertical_agent and verticad to come up. how can i tell when vertica is ready to accept connections

Comments

  • When configuring the load balancer, we set it up to verify that "select 1" executes against each node to confirm that they are responding. You could do something similar to confirm that that database in general is ready to accept connections. --Sharon
  • or you could poll on the following command and wait until all nodes are in "UP" state. admintools -t view_cluster
  • Hi Kiryl. IMHO 'vsql -l' little better than 'admintools -t view_cluster'. Because it doesn't matter if DB is running or not your statement always returns an answer and you need to parse it to understand. In my case you just checks a return code - 0 or whatever. When db is ready:
      [email protected]:/tmp$ vsql -l  List of databases   name | user_name   ------+-----------   test | daniel  (1 row)  [email protected]:/tmp$ echo $?  0  
    When db is not ready:
      [email protected]:/tmp$ vsql -l  vsql: could not connect to server: Connection refused   Is the server running on host "???" and accepting   TCP/IP connections on port 5433?  [email protected]:/tmp$ vsql -l 2>/dev/null  [email protected]:/tmp$ echo $?  2  
    Bash validation:
      if [[ '/opt/vertica/bin/vsql -l 2>/dev/null' ]]; then       echo 'READY';   else       echo 'NOT READY';   fi  
    Test:
      [email protected]:/tmp$ if [[ '/opt/vertica/bin/vsql -l 2>/dev/null' ]]; then echo 'READY'; else echo 'NOT READY'; fi  NOT READY  
  • Yes, this is another way of doing it. Thanks for sharing.

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.