# 建立数据库用户及权限
create database neutron;
grant all privileges on neutron.* to neutron@'localhost' identified by 'Abc@123';
grant all privileges on neutron.* to neutron@'%' identified by 'Abc@123';
flush privileges;
# 建立用户、角色、服务、项目、域、端点
source ~/.openstack_admin
openstack user create --domain default --project service --password Abc@123 neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron --description "OpenStack Networking service" network openstack endpoint create --region RegionOne network public http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696

```bash
# 安装程序包
yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
```


```bash
# 变更配置文件
mv /etc/neutron/neutron.conf /etc/neutron/neutron.conf.org

cat > /etc/neutron/neutron.conf << EOF

[DEFAULT]

core_plugin = ml2

service_plugin =

transport_url = rabbit://openstack:Abc@123@controller

auth_strategy = keystone

notify_nova_on_port_status_changes = true

notify_nova_on_port_data_changes = true

[database]

connection = mysql+pymysql://neutron:Abc@123@controller/neutron

[keystone_authtoken]

www_authenticate_uri = http://controller:5000

auth_url = http://controller:5000/v3

memcached_servers = controller:11211

auth_type = password

project_domain_name = default

user_domain_name = default

project _name = service

username = neutron

password = Abc@123

[nova]

auth_url = http://controller:5000/v3

auth_type = password

project_domain_name = default

user_domain_name = default

project _name = service

region_name = RegionOne

username = nova

password = Abc@123

[oslo_concurrency]

lock_path = /var/lib/neutron/tmp

EOF

chmod 640 /etc/neutron/neutron.conf

chown root:neutron /etc/neutron/neutron.conf

mv /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.org

cat > /etc/neutron/plugins/ml2/ml2_conf.ini <<EOF

[DEFAULT]

[ml2]

type_drivers = flat,vlan

tenant_network_types =

mechanism_drivers = linuxbridge

extension_drivers = port_security

[ml2_type_flat]

flat_networks = provider

[securitygroup]

enable_ipet = true

EOF

chmod 640 /etc/neutron/plugins/ml2/ml2_conf.ini

chown root:neutron /etc/neutron/plugins/ml2/ml2_conf.ini

mv /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.org

cat > /etc/neutron/plugins/ml2/linuxbridge_agent.ini <<EOF

[DEFAULT]

[linux_bridge]

physical_interface_mappings = provider:eth1

[vxlan]

enable_vxlan = false

[securitygroup]

enable_security_group = true

firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

EOF

chmod 640 /etc/neutron/plugins/ml2/linuxbridge_agent.ini

chown root:neutron /etc/neutron/plugins/ml2/linuxbridge_agent.ini

mv /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.org

cat > /etc/neutron/dhcp_agent.ini <<EOF

[DEFAULT]

interface_driver = linuxbridge

dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq

enable_isolated_metadata = true

EOF

chmod 640 /etc/neutron/dhcp_agent.ini

chown root:neutron /etc/neutron/dhcp_agent.ini

/etc/neutron/metadata_agent.ini

[DEFAULT] 项目部分增加

nova_metadata_host = controller

metadata_proxy_shared_secret = Abc@123

[cache] 项目增加

memcache_servers = controller:11211

/etc/nova/nova.conf

未尾部分增加

[neutron]

url = http://controller:9696

auth_url = http://controller:5000/v3

auth_type = password

project_domain_name = default

user_domain_name = default

project _name = service

region_name = RegionOne

username = neutron

password = Abc@123

service_metadata_proxy = True

metadata_proxy_shared_secret = Abc@123

<br>
```bash
# 同步数据库
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/bash -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head" neutron

```bash
# 开启服务
systemctl restart openstack-nova-api && systemctl enable openstack-nova-api
systemctl restart neutron-server && systemctl enable neutron-server
systemctl restart neutron-linuxbridge-agent && systemctl enable neutron-linuxbridge-agent
systemctl restart neutron-dhcp-agent && systemctl enable neutron-dhcp-agent
systemctl restart neutron-metadata-agent && systemctl enable neutron-metadata-agent
```


```bash
# 验证
openstack network agent list
```

openstack stein部署手册 8. neutron-api的更多相关文章

  1. openstack stein部署手册 9. neutron

    # 安装程序包 yum -y install openstack-neutron-linuxbridge ebtables ipset # 变更配置文件 mv /etc/neutron/neutron ...

  2. openstack stein部署手册 7. nova-compute

    # 安装程序包 yum install -y openstack-nova-compute # 变更配置文件 cd /etc/nova mv nova.conf nova.conf.org cat & ...

  3. openstack stein部署手册 6. nova-api

    # 建立数据库用户及权限 create database nova; grant all privileges on nova.* to nova@'localhost' identified by ...

  4. openstack stein部署手册 5. placement

    # 建立数据库用户及权限 create database placement; grant all privileges on placement.* to placement@'localhost' ...

  5. openstack stein部署手册 10. 创建实例

    # 建立网络(provider)与子网 openstack network create --share --external --provider-physical-network provider ...

  6. openstack stein部署手册 4. glance

    # 建立数据库用户及权限 create database glance; grant all privileges on glance.* to glance@'localhost' identifi ...

  7. openstack stein部署手册 3. keystone

    # 建立数据库用户及权限 create database keystone; grant all privileges on keystone.* to keystone@'localhost' id ...

  8. openstack stein部署手册 2. 基础应用

    1. chrony # 安装程序包 yum install -y chrony # 变更配置文件 /etc/chrony.conf 增加 server 192.168.123.200 iburst # ...

  9. openstack stein部署手册 10. horzion

    # 安装程序包 yum install -y openstack-dashboard # 变更配置文件 /etc/openstack-dashboard/local_settings 变更以下 OPE ...

随机推荐

  1. localhost、127.0.0.1、本机ip、0.0.0.0 的区别

    1.各个地址 绑定到127.0.0.1的服务只能被本机访问. localhost是个域名,一般指向127.0.0.1这个ip,绑定到localhost的服务也只能被本机访问. 本机地址,指的是本机物理 ...

  2. BZOJ 5129: [Lydsy1712月赛]树上传送 点分树+Dijkstra

    Description http://www.lydsy.com/JudgeOnline/upload/201712/prob12.pdf Input Output 暑假集训的时候点分树做的比较少,所 ...

  3. 解决报错(Could not create connection to database server.)

    org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory 尝试多种方法后发现是由于mysq ...

  4. TCP学习笔记

    TCP/IP 协议分层模型 TCP/IP 协议族按层次分别分为以下 4 层:应用层.传输层.网络层和数据链路层.层次化之后,每个层级只需要考虑自己的任务就可以了,不再需要弄清其他层级的功能了. TCP ...

  5. B. Equal Rectangles

    B. Equal Rectangles 给定4*N个数,是否能构成N个矩形 面积均相等 每次取两个大的,两个小的 #include<bits/stdc++.h> using namespa ...

  6. 解决 UIAlterController 不居中问题

    最后更新:2017-06-30 现象描述 新公司做的解决的第一个bug 就是 UIAlterController 不居中,莫名其妙的飞出屏幕之外 找了很久的答案,最终在苹果论坛看到了相关的描述 We ...

  7. Alexa TOP 100万的域名列表

    Alexa是一家专门发布网站世界排名的网站,是亚马逊公司的一家子公司.Alexa每天在网上搜集多达几十亿的网址链接,而且为其中的每一个网站进行了排名. Alexa通过Alexa官网查询好像TOP 50 ...

  8. A* 算法求第 K 短路

    一种具有 \(f(n)=g(n)+h(n)\) 策略的启发式算法能成为 A* 算法的充分条件是: 搜索树上存在着从起始点到终了点的最优路径. 问题域是有限的. 所有结点的子结点的搜索代价值 \(> ...

  9. Linux命令行下常用svn命令

    1.Linux命令行下将文件checkout到本地目录 svn checkout path(path是服务器上的目录) 例如:svn checkout svn://192.168.1.1/pro/do ...

  10. 大数据笔记(六)——HDFS的底层原理:JAVA动态代理和RPC

    一.Java的动态代理对象 实现代码如下: 1.接口类MyService package hdfs.proxy; public interface MyService { public void me ...