[ovs-dev] [PATCH] ovn: ovn-ctl support to start ovn db servers in standby mode

Ben Pfaff blp at ovn.org
Tue Aug 30 20:29:35 UTC 2016


On Thu, Aug 25, 2016 at 07:18:03PM +0530, bschanmu at redhat.com wrote:
> This patch adds support to start_ovsdb() function in ovn-ctl to start the
> ovn db servers in standby mode. This can be done in the following ways
> 1. Use parameters --ovn-nb-sync-from-addr and --ovn-sb-sync-from-addr to
>    set the addresses of the master server.
> 2. Create files $etcdir/ovnnb-master.conf and $etcdir/ovnsb-master.conf
>    with the tcp url of the master servers.
> 
> If --ovn-nb-sync-from-addr and --ovn-sb-sync-from-addr is used, it will
> overwrite the contents in the $etcdir/*.conf and use that server as the
> master.
> 
> Additional functions to promote a standby server to master and demote
> master server to standby mode are also added in this patch
> 
> Signed-off-by: Babu Shanmugam <bschanmu at redhat.com>

Andy, do you want to review this?

I have a few comments of my own.

> @@ -54,6 +70,15 @@ start_ovsdb () {
>  
>          set "$@" --detach $OVN_NB_LOG --log-file=$OVN_NB_LOGFILE --remote=punix:$DB_NB_SOCK --remote=ptcp:$DB_NB_PORT:$DB_NB_ADDR --pidfile=$DB_NB_PID --unixctl=ovnnb_db.ctl
>  
> +        ovnnb_master_conf_file="$etcdir/ovnnb-master.conf"

The argument to -z should be in "" here:

> +        if test ! -z $DB_NB_SYNC_FROM_ADDR; then
> +            echo "tcp:$DB_NB_SYNC_FROM_ADDR:$DB_NB_SYNC_FROM_PORT" > $ovnnb_master_conf_file
> +        fi

Also in another case later.

Thanks,

Ben.



More information about the dev mailing list