openvswitch 2.1.2 安装完成后 启动 与 停止 shell脚本

来源:互联网 发布:阿里妈妈淘宝客官网 编辑:程序博客网 时间:2024/06/07 01:16

openvswitch 2.1.2 安装完成后,会经常遇到启动与停止的情况,为了避免重复手写启动停止的终端代码,最好将其写在不同的脚本里,方便下次调用。前提是已经安装好了openvswitch,并按照下面到语句建立好了数据库conf.db

    mkdir -p /usr/local/etc/openvswitch    ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema



开始脚本:

ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \            --remote=db:Open_vSwitch,Open_vSwitch,manager_options \    --private-key=db:Open_vSwitch,SSL,private_key \            --certificate=db:Open_vSwitch,SSL,certificate \--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \--pidfile --detachovs-vsctl --no-wait initovs-vswitchd --pidfile --detach

开启ovsdb-server、-vswtichd服务。



停止脚本:

kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid`##cat ovs-brcompatd.pid ovs-controller.pid ovs-monitor-ipsec.pid##
进入openvswitch的安装路径,杀死ovsdb-server 、ovs-vswitchd 进程。

0 0
原创粉丝点击