Automatically launch backup server for OVN SB database that replicates all transactions of the active server. This can be handy for experimenting with the newly added replication feature.
Signed-off-by: Andy Zhou <az...@ovn.org> --- tutorial/ovs-sandbox | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox index 69c2c68..6f03ede 100755 --- a/tutorial/ovs-sandbox +++ b/tutorial/ovs-sandbox @@ -316,10 +316,12 @@ if $ovn; then touch "$sandbox"/.ovnsb.db.~lock~ touch "$sandbox"/.ovnnb.db.~lock~ run ovsdb-tool create ovnsb.db "$ovnsb_schema" + run ovsdb-tool create ovnsb2.db "$ovnsb_schema" run ovsdb-tool create ovnnb.db "$ovnnb_schema" run ovsdb-tool create vtep.db "$vtep_schema" ovsdb_server_args="vtep.db conf.db" ovsdb_sb_server_args="ovnsb.db" + ovsdb_sb_backup_server_args="ovnsb2.db" ovsdb_nb_server_args="ovnnb.db" fi rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \ @@ -333,6 +335,13 @@ if $ovn; then --pidfile="$sandbox"/ovnsb_db.pid -vconsole:off \ --log-file="$sandbox"/ovnsb_db.log \ --remote=punix:"$sandbox"/ovnsb_db.sock $ovsdb_sb_server_args + # Start SB back up server + rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir \ + --pidfile="$sandbox"/ovnsb_db2.pid -vconsole:off \ + --log-file="$sandbox"/ovnsb_db2.log \ + --remote=punix:"$sandbox"/ovnsb_db2.sock \ + --unixctl="$sandbox"/sb_backup_unixctl \ + --sync-from=unix:"$sandbox"/ovnsb_db.sock $ovsdb_sb_backup_server_args fi #Add a small delay to allow ovsdb-server to launch. @@ -389,6 +398,12 @@ if $ovn; then cat << EOF This environment also has the OVN daemons and databases enabled. You can use ovn-nbctl and ovn-sbctl to interact with the OVN databases. +The backup server of OVN SB can be accessed by: +* ovn-sbctl --db=unix:`pwd`/sandbox/ovnsb_db2.sock +* ovs-appctl -t `pwd`/sandbox/sb_backup_unixctl +The backup database file is "sandbox"/ovnsb2.db + + EOF fi cat <<EOF -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev