OVS命令详解

来源:互联网 发布:淘宝查小号信誉 编辑:程序博客网 时间:2024/06/06 03:23

ovsdb-server:

       ovsdb-server [database]...  [--remote=remote]...  [--run=command]       ovsdb-server命令提供了访问OVSDB数据库的RPC接口的服务。       database参数指定了OVSDB存放的文件位置,如果不指定,则默认是/etc/openvswitch/conf.db。该数据库文件必须先用ovsdb-tool create命令创建。       remote参数指定了数据库服务器使用的连接方式:                punix:file  表示使用本地文件进行进程间socket的通信,收发数据。                 db:db,table,column  表示使用数据库中定义的连接方式。               例如:
               ovsdb-server --remote=db:Open_vSwitch,Open_vSwitch,manager_options
该命令指定了从名为“Open_vSwitch”的数据库中名为“Open_vSwitch”的table的manager_options字段中获取,如下Appendix A是从conf.db文件中摘录的配置
manager_options指定了类型为uuid,从对应的Manager表的target字段中获取连接方式。
当数据库字段内容修改时,会自动变更服务器的连接方式。
manager_options也可以设置类型为字符串,如果是字符串类型,则直接从manager_options字段中获取连接方式。
pidfile参数指定了pidfile文件的路径。pidfile的作用是为了防止程序进程启动多个副本,只有获取该文件控制权的进程可以启动。
detach参数指定后表示数据库服务器在后台启动。

实际启动ovsdb数据库服务的例子:
      ovsdb-server  --remote=punix:/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


APPENDIX A:
/*从conf.db中摘录的配置*/
 "manager_options":{"type":{"max":"unlimited","min":0,"key":{"type":"uuid","refTable":"Manager"}}}
"Manager":{"indexes":[["target"]],           "columns":{"is_connected":{"ephemeral":true,                                                                         "type":"boolean"                                                                                                                    },                      "connection_mode":{"type":{"min":0,                                                 "key":{"type":"string",                                                                                                                         "enum":["set",["in-band","out-of-band"]]                                                        }                                                                                                                }                                                              },                           "other_config":{"type":{"max":"unlimited",                                                                                                           "min":0,                                                                            "key":"string",                                                                           "value":"string"                                                                                                         }                                                                                      },                      "external_ids":{"type":{"max":"unlimited",                                                                           "min":0,                                                                           "key":"string",                                                                                                            "value":"string"                                                                                                         }                                                                                                     },                           "status":{"ephemeral":true,                                          "type":{"max":"unlimited",                                                            "min":0,                                                            "key":"string",                                                                  "value":"string"                                                                        }                                                                                               },                          "target":{"type":"string"                                                                               },                              "inactivity_probe":{"type":{"min":0,                                                                                                "key":"integer"                                                                                  }                                                                    },                      "max_backoff":{"type":{"min":0,                                                                                         "key":{"minInteger":1000,                                                                                                        "type":"integer"                                                                                                                       }
                                                                                                                                                           }
                                                                                                                                       }
                                              }          }

0 0