Skip to content

Commit

Permalink
fix: use ovsdb-client to get leader info
Browse files Browse the repository at this point in the history
When log rotated, previous method will lost all leader
  • Loading branch information
oilbeater committed May 22, 2019
1 parent cb176ab commit 24259db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/images/ovn-is-leader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ ovn-ctl status_ovnnb
ovn-ctl status_ovnsb

# For data consistency, only store leader address in endpoint
echo $(cat /var/log/openvswitch/ovn-northd.log) | grep -oP "lock acquired(?!.*lock lost).*$"
ovsdb-client query tcp:127.0.0.1:6641 "[\"_Server\",{\"table\":\"Database\",\"where\":[[\"name\",\"==\", \"OVN_Northbound\"]],\"columns\": [\"leader\"],\"op\":\"select\"}]" | grep true

0 comments on commit 24259db

Please sign in to comment.