OpenStack Queens三节点从零部署-安装部署Neutron(一)

最后修改时间:2018年6月28日

文档版本:1.0

本操作在控制节点上完成

一. 在Keystone中添加用户及其他服务相关

# 添加neutron用户
root@controller:~(keystone)# openstack user create --domain default --project service --password root neutron
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | nn3c2r0rc32m0xmr89q3xm0tq8cqrm09 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 83jf83jd912j7fhsf83jgr3j3d2ga12f |
| name                | neutron                          |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
 
# 为用户添加管理员角色
root@controller:~(keystone)# openstack role add --project service --user neutron admin
 
# 创建服务
root@controller:~(keystone)# openstack service create --name neutron --description "OpenStack Networking service" network
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking service     |
| enabled     | True                             |
| id          | 893jc89rnfe9021n56367t4nhjgf8743 |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+
 
# 定义一个临时变量,避免重复输入controller的IP
root@controller:~(keystone)# export controller=192.168.0.10
 
# 创建nentron服务endpoint(public,internal,admin)
root@controller:~(keystone)# openstack endpoint create --region RegionOne network public http://$controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 9854jrge954908rgwe234r1895th89w3 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 893jc89rnfe9021n56367t4nhjgf8743 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://192.168.0.10:9696         |
+--------------+----------------------------------+
 
root@controller:~(keystone)# openstack endpoint create --region RegionOne network internal http://$controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 546nu34r7f452g2qt98317f3h348th34 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 893jc89rnfe9021n56367t4nhjgf8743 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://192.168.0.10:9696         |
+--------------+----------------------------------+
 
root@controller:~(keystone)# openstack endpoint create --region RegionOne network admin http://$controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 23hj54h3e873s124ru3ks1q768hurq38 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 893jc89rnfe9021n56367t4nhjgf8743 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://192.168.0.10:9696         |
+--------------+----------------------------------+

二. 为neutron添加数据库

root@controller:~(keystone)# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 32
Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
# 添加数据库
MariaDB [(none)]> create database neutron_ml2;
Query OK, 1 row affected (0.00 sec)
 
# 为数据库赋予用户权限
MariaDB [(none)]> grant all privileges on neutron_ml2.* to neutron@'localhost' identified by 'root';
Query OK, 0 row affected (0.00 sec)
 
MariaDB [(none)]> grant all privileges on neutron_ml2.* to neutron@'%' identified by 'root';
Query OK, 0 row affected (0.00 sec)
 
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> exit
Bye
Leave a Reply