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:
      daniel@synapse:/tmp$ vsql -l  List of databases   name | user_name   ------+-----------   test | daniel  (1 row)  daniel@synapse:/tmp$ echo $?  0  
    When db is not ready:
      daniel@synapse:/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?  daniel@synapse:/tmp$ vsql -l 2>/dev/null  daniel@synapse:/tmp$ echo $?  2  
    Bash validation:
      if [[ '/opt/vertica/bin/vsql -l 2>/dev/null' ]]; then       echo 'READY';   else       echo 'NOT READY';   fi  
    Test:
      daniel@synapse:/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