3 ovs 安装

`ovs 安装

1  下载
    # wget https://www.openvswitch.org/releases/openvswitch-2.12.0.tar.gz

2  解压,编译
# tar -xzf openvswitch-2.12.0.tar.gz
# ../configure
# make
# make install

3 加载模块
 # modprobe openvswitch
 # lsmod | grep openvswitch

4  环境变量  vi  /etc/profile.d/ovs.sh

export PATH=$PATH:/usr/local/share/openvswitch/scripts
source ~/.bash_profile



5. 启动
启动ovs shell  
ovs-ctl start

启动ovs-vswitchd服务
ovs-ctl --no-ovs-vswitchd start

启动ovsdb-server服务
ovs-ctl --no--ovsdb-server start


6 关闭ovs
 kill  ovsdb-server.pid ovs-vswitchd.pid

7 # ovs-vsctl show
    388cc00d-685d-48a9-a8f4-ba236504dcfa
         ovs_version: "2.12.0"


---------------------------------------------------------------------------
也可用启动脚本:

5 初始化数据库
 mkdir -p /usr/local/etc/openvswitch
 mkdir -p /usr/local/var/run/openvswitch

6 创建日志文件
  mkdir -p /usr/local/etc/openvswitch
  //ovsdb-tool create /usr/local/etc/openvswitch/conf.db  vswitchd/vswitch.ovsschema
  mkdir -p /usr/local/var/run/openvswitch

7   启动脚本  ovs-start
    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 --detach --log-file
    ovs-vsctl --no-wait init
    ovs-vswitchd --pidfile --detach --log-file

# 修改为可执行
    chmod  a+x ovs-start

# 启动
    ./ovs-start


8  停止脚本

    kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid`

posted @ 2020-06-23 22:24  abel2020  阅读(343)  评论(0编辑  收藏  举报