> From V3 removed any unnecessary code change and removed cloning of the
> running ovsdb configuration database. We should address SSL in a specific
> patch without depending on the default database.
>
> Signed-off-by: Michael Arnaldi <arnaldimichael at gmail.com>
>
> ---
> NEWS                      |   4 ++
>  ovn/northd/ovn-northd.c   |  33 ++++++---
>  ovn/utilities/ovn-ctl     | 167 +++++++++++++++++++++++++++++++++++
+----------

[snip for bandwidth]

> diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
> index b171934..2ad0eb0 100755
> --- a/ovn/utilities/ovn-ctl
> +++ b/ovn/utilities/ovn-ctl
> @@ -30,32 +30,81 @@ done
>  ## start ##
>  ## ----- ##
>
> -upgrade_ovn_dbs () {
> -    ovn_dbs=$(ovs-appctl -t ovsdb-server ovsdb-server/list-dbs
2>/dev/null)
> -    for db in $ovn_dbs; do
> -        case $db in
> -            OVN*)
> -                action "Removing $db from ovsdb-server" \
> -                    ovs-appctl -t ovsdb-server ovsdb-server/remove-db
$db
> -                ;;
> -        esac
> -    done
> -    upgrade_db "$DB_NB_FILE" "$DB_NB_SCHEMA"
> -    upgrade_db "$DB_SB_FILE" "$DB_SB_SCHEMA"
> -    for db in $DB_NB_FILE $DB_SB_FILE; do
> -        action "Adding $db to ovsdb-server" \
> -            ovs-appctl -t ovsdb-server ovsdb-server/add-db $db || exit 1
> -    done
> +pidfile_is_running () {
> +    pidfile=$1
> +    test -e "$pidfile" && pid=`cat "$pidfile"` && pid_exists "$pid"
> +} >/dev/null 2>&1
> +
> +stop_ovsdb () {
> +    if pidfile_is_running $DB_NB_PID; then
> +        kill -9 $(cat $DB_NB_PID) 1>/dev/null 2>/dev/null
> +        rm -f $DB_NB_PID 1>/dev/null 2>/dev/null
> +    fi
> +
> +    if pidfile_is_running $DB_SB_PID; then
> +        kill -9 $(cat $DB_SB_PID) 1>/dev/null 2>/dev/null
> +        rm -f $DB_SB_PID 1>/dev/null 2>/dev/null
> +    fi
> +}
> +
> +start_ovsdb () {
> +    # Check and eventually start ovsdb-server for Northbound DB
> +    if ! pidfile_is_running $DB_NB_PID; then
> +        upgrade_db "$DB_NB_FILE" "$DB_NB_SCHEMA" 1>/dev/null 2>/dev/null
> +
> +        set ovsdb-server
> +
> +        set "$@" --detach $OVN_OVSDB_LOG --remote=punix:$DB_NB_SOCK
--remote=ptcp:$DB_NB_PORT --pidfile=$DB_NB_PID

OVN_OVSDB_LOG really needs to also be split between the NB and SB
processes, otherwise the logs conflate and are
unusable

> +
> +        $@ $DB_NB_FILE
> +    fi
> +
> +    # Check and eventually start ovsdb-server for Southbound DB
> +    if ! pidfile_is_running $DB_SB_PID; then
> +        upgrade_db "$DB_SB_FILE" "$DB_SB_SCHEMA" 1>/dev/null 2>/dev/null
> +
> +        set ovsdb-server
> +
> +        set "$@" --detach $OVN_OVSDB_LOG --remote=punix:$DB_SB_SOCK
--remote=ptcp:$DB_SB_PORT --pidfile=$DB_SB_PID

See above

> +        $@ $DB_SB_FILE
> +    fi
> +}
> +
> +status_ovsdb () {
> +  if ! pidfile_is_running $DB_NB_PID; then
> +      log_success_msg "OVN Northbound DB is not running"
> +  else
> +      log_success_msg "OVN Northbound DB is running"
> +  fi
> +
> +  if ! pidfile_is_running $DB_SB_PID; then
> +      log_success_msg "OVN Southbound DB is not running"
> +  else
> +      log_success_msg "OVN Southbound DB is running"
> +  fi
>  }
>
>  start_northd () {
> -    # We expect ovn-northd to be co-located with ovsdb-server handling
both the
> -    # OVN_Northbound and OVN_Southbound dbs.
> -    upgrade_ovn_dbs
> +  if test X"$OVN_MANAGE_OVSDB" = Xyes; then
> +      start_ovsdb
> +  fi
>
> -    set ovn-northd
> -    set "$@" -vconsole:emer -vsyslog:err -vfile:info
> -    OVS_RUNDIR=${OVN_RUNDIR} start_daemon "$OVN_NORTHD_PRIORITY"
"$OVN_NORTHD_WRAPPER" "$@"
> +  if ! pidfile_is_running $DB_NB_PID; then
> +      log_failure_msg "OVN Northbound DB is not running"
> +      exit
> +  fi
> +  if ! pidfile_is_running $DB_SB_PID; then
> +      log_failure_msg "OVN Southbound DB is not running"
> +      exit
> +  fi
> +
> +  if daemon_is_running ovn-northd; then
> +      log_success_msg "OVN Northbound is already running"
> +  else
> +      set ovn-northd
> +      set "$@" $OVN_NORTHD_LOG --ovnnb-db=unix:$DB_NB_SOCK
--ovnsb-db=unix:$DB_SB_SOCK
> +      OVS_RUNDIR=${OVN_RUNDIR} start_daemon "$OVN_NORTHD_PRIORITY"
"$OVN_NORTHD_WRAPPER" "$@"
> +  fi
>  }
>
>  start_controller () {

[snip]

> @@ -90,24 +143,46 @@ restart_controller () {
>      start_controller
>  }
>
> +restart_ovsdb () {
> +    stop_ovsdb
> +    start_ovsdb
> +}
> +
>  ## ---- ##
>  ## main ##
>  ## ---- ##
>
>  set_defaults () {
> -    DB_SOCK=$rundir/db.sock
> -    DB_NB_FILE=$dbdir/ovnnb.db
> -    DB_SB_FILE=$dbdir/ovnsb.db
> -    DB_NB_SCHEMA=$datadir/ovn-nb.ovsschema
> -    DB_SB_SCHEMA=$datadir/ovn-sb.ovsschema
> -
> -    OVN_NORTHD_PRIORITY=-10
> -    OVN_NORTHD_WRAPPER=
> -    OVN_CONTROLLER_PRIORITY=-10
> -    OVN_CONTROLLER_WRAPPER=
> -
> -    OVS_RUNDIR=${OVS_RUNDIR:-${rundir}}
> -    OVN_RUNDIR=${OVN_RUNDIR:-${OVS_RUNDIR}}
> +  OVN_DIR=$rundir
> +  OVN_MANAGE_OVSDB=yes
> +
> +  DB_NB_SOCK=$OVN_DIR/ovnnb_db.sock
> +  DB_NB_PID=$OVN_DIR/ovnnb_db.pid
> +  DB_NB_FILE=$OVN_DIR/ovnnb_db.db
> +  DB_NB_PORT=6641
> +
> +  DB_SB_SOCK=$OVN_DIR/ovnsb_db.sock
> +  DB_SB_PID=$OVN_DIR/ovnsb_db.pid
> +  DB_SB_FILE=$OVN_DIR/ovnsb_db.db
> +  DB_SB_PORT=6642
> +
> +  DB_NB_SCHEMA=$datadir/ovn-nb.ovsschema
> +  DB_SB_SCHEMA=$datadir/ovn-sb.ovsschema
> +
> +  DB_SOCK=$rundir/db.sock
> +  DB_CONF_FILE=$dbdir/conf.db
> +
> +  OVN_NORTHD_PRIORITY=-10
> +  OVN_NORTHD_WRAPPER=
> +  OVN_CONTROLLER_PRIORITY=-10
> +  OVN_CONTROLLER_WRAPPER=
> +
> +  OVS_RUNDIR=${OVS_RUNDIR:-${rundir}}
> +  OVN_RUNDIR=${OVN_RUNDIR:-${OVS_RUNDIR}}
> +
> +  OVN_CONTROLLER_LOG="-vconsole:emer -vsyslog:err -vfile:info"
> +  OVN_NORHD_LOG="-vconsole:emer -vsyslog:err -vfile:info"

Typo: should be OVN_NORTHD_LOG

> +  OVN_OVSDB_LOG="-vconsole:off"
>  }
>
>  set_option () {

Ryan Moats
(regXboi)
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to