Options
We want to get current epoch and ahm_epoch value from the vertica.log on each node.
We want to get current epoch and ahm_epoch value from the vertica.log on each node.
Anyone, please advice me how to identify these value from vertica.log
0
Answers
The CE and AHM should be the same across the cluster unless a node is down.
dbadmin=> SELECT get_current_epoch(), get_ahm_epoch(); get_current_epoch | get_ahm_epoch -------------------+--------------- 906 | 904 (1 row)You can find the AHM in the vertica.log file on each node with Linux commands... something like the following (I have 3 nodes, database name is test_db):
[dbadmin@vertica01 ~]$ ssh vertica01 "grep \"GetClusterAHMCandidate: My local node AHM candidate =\" /home/dbadmin/test_db/v_test_db_node0001_catalog/vertica.log | tail -1" | awk 'NF>1{print $NF}' 0x388 [dbadmin@vertica01 ~]$ ssh vertica02 "grep \"GetClusterAHMCandidate: My local node AHM candidate =\" /home/dbadmin/test_db/v_test_db_node0002_catalog/vertica.log | tail -1" | awk 'NF>1{print $NF}' 0x388 [dbadmin@vertica01 ~]$ ssh vertica03 "grep \"GetClusterAHMCandidate: My local node AHM candidate =\" /home/dbadmin/test_db/v_test_db_node0003_catalog/vertica.log | tail -1" | awk 'NF>1{print $NF}' 0x388Note that the log file stores epochs in HEX. You can convert them to integer in Linux like this:
Similarly, you can find the Current Epoch in Vertica logs...
[dbadmin@vertica01 v_test_db_node0001_catalog]$ ssh vertica01 "grep \"Commit Complete: Txn:\" /home/dbadmin/test_db/v_test_db_node0001_catalog/vertica.log | tail -1" | awk '{print $12}' 0x38a [dbadmin@vertica01 v_test_db_node0001_catalog]$ ssh vertica02 "grep \"Commit Complete: Txn:\" /home/dbadmin/test_db/v_test_db_node0002_catalog/vertica.log | tail -1" | awk '{print $12}' 0x38a [dbadmin@vertica01 v_test_db_node0001_catalog]$ ssh vertica03 "grep \"Commit Complete: Txn:\" /home/dbadmin/test_db/v_test_db_node0003_catalog/vertica.log | tail -1" | awk '{print $12}' 0x38a [dbadmin@vertica01 v_test_db_node0001_catalog]$ printf '%d\n' "0x38a" 906Hi,
Best method is to look for Epoch.log file which is located under your catalog directory:
catalog//v___catalog/Epoch.log
Sure!
But the Epoch.log file, which is used during recovery to indicate the latest epoch that contains a complete set of data, is only there when the DB or node was shut down cleanly. It's not there on an up DB or after a crash.
Examples:
DB shut down cleanly (Epoch.log created):
[dbadmin@vertica01 v_test_db_node0001_catalog]$ ls *.log bootstrap-catalog.log editor.log startup.log vertica.log [dbadmin@vertica01 v_test_db_node0001_catalog]$ admintools -t stop_db -d test_db Info: no password specified, using none Connecting to database Issuing shutdown command to database Database test_db stopped successfully [dbadmin@vertica01 v_test_db_node0001_catalog]$ ls *.log bootstrap-catalog.log editor.log Epoch.log startup.log vertica.logNode shut down cleanly, after restarting the DB (Epoch.log created):
[dbadmin@vertica01 v_test_db_node0001_catalog]$ ls *.log bootstrap-catalog.log editor.log startup.log vertica.log [dbadmin@vertica01 v_test_db_node0001_catalog]$ admintools -t stop_node -s vertica01 *** Forcing host shutdown *** Sending host shutdown command to '192.168.2.200' [dbadmin@vertica01 v_test_db_node0001_catalog]$ ls *.log bootstrap-catalog.log editor.log Epoch.log startup.log vertica.logDB node killed, after restarting node from previous example (Epoch.log NOT created):
Hello Jim,
thanks for the clarification. In our case, most of the time, we find this file in our system so it is easy for us to use it.