@@ -38,16 +38,23 @@ pidfile_is_running () {
test -e "$pidfile" && pid=`cat "$pidfile"` && pid_exists "$pid"
} >/dev/null 2>&1
-stop_ovsdb () {
+stop_ovnnb() {
if pidfile_is_running $DB_NB_PID; then
ovs-appctl -t $rundir/ovnnb_db.ctl exit
fi
+}
+stop_ovnsb() {
if pidfile_is_running $DB_SB_PID; then
ovs-appctl -t $rundir/ovnsb_db.ctl exit
fi
}
+stop_ovsdb() {
+ stop_ovnnb
+ stop_ovnsb
+}
+
demote_ovnnb() {
if test ! -z "$DB_NB_SYNC_FROM_ADDR"; then
echo "tcp:$DB_NB_SYNC_FROM_ADDR:$DB_NB_SYNC_FROM_PORT" > $ovnnb_active_conf_file
@@ -86,7 +93,7 @@ promote_ovnsb() {
ovs-appctl -t $rundir/ovnsb_db.ctl ovsdb-server/disconnect-active-ovsdb-server
}
-start_ovsdb () {
+start_ovnnb() {
# 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
@@ -111,7 +118,9 @@ start_ovsdb () {
$@ $DB_NB_FILE
ovn-nbctl init
fi
+}
+start_ovnsb() {
# 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
@@ -138,6 +147,11 @@ start_ovsdb () {
fi
}
+start_ovsdb() {
+ start_ovnnb
+ start_ovnsb
+}
+
sync_status() {
ovs-appctl -t $rundir/ovn${1}_db.ctl ovsdb-server/sync-status | awk '{if(NR==1) print $2}'
}
@@ -334,10 +348,14 @@ startup scripts. System administrators should not normally invoke it directly.
Commands:
start_northd start ovn-northd
start_ovsdb start ovn related ovsdb-server processes
+ start_ovnnb start ovn northbound database server processes
+ start_ovnsb start ovn southbound database server processes
start_controller start ovn-controller
start_controller_vtep start ovn-controller-vtep
stop_northd stop ovn-northd
stop_ovsdb stop ovn related ovsdb-server processes
+ stop_ovnnb stop ovn northbound database server processes
+ stop_ovnsb stop ovn southbound database server processes
stop_controller stop ovn-controller
stop_controller_vtep stop ovn-controller-vtep
restart_northd restart ovn-northd
@@ -439,6 +457,12 @@ case $command in
start_ovsdb)
start_ovsdb
;;
+ start_ovnnb)
+ start_ovnnb
+ ;;
+ start_ovnsb)
+ start_ovnsb
+ ;;
start_controller)
start_controller
;;
@@ -448,6 +472,33 @@ case $command in
stop_northd)
stop_northd
;;
+ stop_ovnnb)
+ stop_ovnnb
+ ;;
+ stop_ovnsb)
+ stop_ovnsb
+ ;;
+ stop_ovsdb)
+ stop_ovsdb
+ ;;
+ stop_controller)
+ stop_controller
+ ;;
+ stop_controller)
+ stop_controller
+ ;;
+ stop_controller_vtep)
+ stop_controller_vtep
+ ;;
+ restart_northd)
+ restart_northd
+ ;;
+ restart_ovsdb)
+ restart_ovsdb
+ ;;
+ restart_controller)
+ restart_controller
+ ;;
stop_ovsdb)
stop_ovsdb
;;
@@ -16,9 +16,13 @@
<dt><code>start_northd</code></dt>
<dt><code>start_controller</code></dt>
<dt><code>start_controller_vtep</code></dt>
+ <dt><code>start_ovnnb</code></dt>
+ <dt><code>start_ovnsb</code></dt>
<dt><code>stop_northd</code></dt>
<dt><code>stop_controller</code></dt>
<dt><code>stop_controller_vtep</code></dt>
+ <dt><code>stop_ovnnb</code></dt>
+ <dt><code>stop_ovnsb</code></dt>
<dt><code>restart_northd</code></dt>
<dt><code>restart_controller</code></dt>
<dt><code>restart_controller_vtep</code></dt>
Current ovn-ctl starts and stops both southbound and northbound DBs at the same time. Future patches will provide services that start them individually. Signed-off-by: Andy Zhou <azhou@ovn.org> --- ovn/utilities/ovn-ctl | 55 +++++++++++++++++++++++++++++++++++++++++++-- ovn/utilities/ovn-ctl.8.xml | 4 ++++ 2 files changed, 57 insertions(+), 2 deletions(-)