forked from ovn-org/ovn
/
start-ovn
executable file
·91 lines (90 loc) · 4.52 KB
/
start-ovn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
case $1 in
"ovn-nb") /usr/share/ovn/scripts/ovn-ctl run_nb_ovsdb
;;
"ovn-sb") /usr/share/ovn/scripts/ovn-ctl run_sb_ovsdb
;;
"ovn-northd") ovn-northd --pidfile \
--ovnnb-db="unix:/var/run/ovn/ovnnb_db.sock" \
--ovnsb-db="unix:/var/run/ovn/ovnsb_db.sock" \
--log-file=/var/log/ovn/ovn-northd.log
;;
"ovn-northd-cluster") ovn-northd --pidfile \
--ovnnb-db=$OVN_NB_DB \
--ovnsb-db=$OVN_SB_DB \
--log-file=/var/log/ovn/ovn-northd.log
;;
"ovn-nb-tcp") source /etc/ovn/ovn_default_nb_port
/usr/share/ovn/scripts/ovn-ctl start_ovsdb
ovn-nbctl set-connection ptcp:$nb_db_port
/usr/share/ovn/scripts/ovn-ctl stop_ovsdb
/usr/share/ovn/scripts/ovn-ctl run_nb_ovsdb
;;
"ovn-nb-cluster-create") /usr/share/ovn/scripts/ovn-ctl \
--db-nb-addr=$host_ip \
--db-nb-cluster-local-addr=$host_ip \
start_nb_ovsdb
ovn-nbctl set-connection ptcp:$nb_db_port
/usr/share/ovn/scripts/ovn-ctl stop_nb_ovsdb
/usr/share/ovn/scripts/ovn-ctl \
--db-nb-addr=$host_ip \
--db-nb-cluster-local-addr=$host_ip \
run_nb_ovsdb
;;
"ovn-nb-cluster-join") /usr/share/ovn/scripts/ovn-ctl \
--db-nb-addr=$host_ip \
--db-nb-cluster-local-addr=$host_ip \
--db-nb-cluster-remote-addr=$remote_host \
run_nb_ovsdb
;;
"ovn-sb-tcp") source /etc/ovn/ovn_default_sb_port
/usr/share/ovn/scripts/ovn-ctl start_ovsdb
ovn-sbctl set-connection ptcp:$sb_db_port
/usr/share/ovn/scripts/ovn-ctl stop_ovsdb
/usr/share/ovn/scripts/ovn-ctl run_sb_ovsdb
;;
"ovn-northd-tcp") source /etc/ovn/ovn_default_northd_host
source /etc/ovn/ovn_default_nb_port
source /etc/ovn/ovn_default_sb_port
ovn-northd --pidfile \
--ovnnb-db="tcp:$northd_host:$nb_db_port" \
--ovnsb-db="tcp:$northd_host:$sb_db_port" \
--log-file=/var/log/ovn/ovn-northd.log
;;
"ovn-sb-cluster-create") /usr/share/ovn/scripts/ovn-ctl \
--db-sb-addr=$host_ip \
--db-sb-cluster-local-addr=$host_ip \
start_sb_ovsdb
ovn-sbctl set-connection ptcp:$sb_db_port
/usr/share/ovn/scripts/ovn-ctl stop_sb_ovsdb
/usr/share/ovn/scripts/ovn-ctl \
--db-sb-addr=$host_ip \
--db-sb-cluster-local-addr=$host_ip \
run_sb_ovsdb
;;
"ovn-sb-cluster-join") /usr/share/ovn/scripts/ovn-ctl \
--db-sb-addr=$host_ip \
--db-sb-cluster-local-addr=$host_ip \
--db-sb-cluster-remote-addr=$remote_host \
run_sb_ovsdb
;;
"ovn-controller") ovn-controller --pidfile \
--log-file=/var/log/ovn/ovn-controller.log
;;
*) echo "$0 [ovn-nb-tcp|ovn-sb-tcp|ovn-northd-tcp|ovn-controller
|ovn-nb-cluster-create|ovn-nb-cluster-join
|ovn-sb-cluster-create|ovn-sb-cluster-join
|ovn-northd-cluster]"
esac