感谢指剑大佬发表的博客与视频!感谢所 爱大佬的支持!
(四)Open Stack(M)----Nova服务安装与配置
1.创建网络服务数据库(在controller 节点执行)
1)进入数据库
mysql -uroot -p000000
2)创建数据库(neutron )
create database neutron;
3)创建neutron用户并授予所有权限本地登陆并设置密码
grant all privileges on neutron.* to 'neutron'@'localhost' identified by '000000';
4)创建neutron用户并授予所有权限任意地点登陆并设置密码
grant all privileges on neutron.* to 'neutron'@'%' identified by '000000';
5)退出数据库
\q
截图如下
2.获得管理员访问权限(在controller 节点执行)
. /root/admin-openrc
3.创建服务证书,neutron用户(在controller 节点执行)
1)创建 neutron 用户
openstack user create --domain default --password 000000 neutron
2)给 neutron 用户添加 admin 角色
openstack role add --project service --user neutron admin
3)创建 neutron 服务实体
openstack service create --name neutron --description "OpenStack Networking" network
截图如下
4.创建网络服务API端点(在controller 节点执行)
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
截图如下
5.安装并配置网络服务组件(在controller 节点执行)
1.下载软件
yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
2.编辑配置文件 /etc/neutron/neutron.conf
vi /etc/neutron/neutron.conf
在 [database] 部分下,添加
connection = mysql+pymysql://neutron:000000@controller/neutron
在[DEFAULT]部分,添加如下内容
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
rpc_backend = rabbit
auth_strategy = keystone
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
在[oslo_messaging_rabbit]部分,配添加如下内容:
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 000000
在[keystone_authtoken]部分,添加如下内容
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 000000
在[nova]部分,添加如下内容
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = 000000
在 [oslo_concurrency]部分,添加如下内容
lock_path = /var/lib/neutron/tmp
部分截图如下
3.编辑/etc/neutron/plugins/ml2/ml2_conf.ini 文件
vi /etc/neutron/plugins/ml2/ml2_conf.ini
在[ml2]下添加,添加如下内容
type_drivers = flat,vlan,vxlan,gre,local
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
在 [ml2_type_flat] 部分,添加如下内容
flat_networks = provider
在 [ml2_type_vxlan] 部分,添加如下内容
vni_ranges = 1:1000
在 [securitygroup] 部分,添加如下内容
enable_ipset = True
部分截图如下
4.配置linuxbridge代理,编辑文件/etc/neutron/plugins/ml2/linuxbridge_agent.ini
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
在[linux_bridge]部分,添加如下内容
physical_interface_mappings = provider:eth1
在[vxlan]部分,添加如下内容
enable_vxlan = True
local_ip = 192.168.100.10
l2_population = True
在[securitygroup]部分,添加如下内容
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
部分截图如下
5.配置layer-3 代理,编辑文件/etc/neutron/l3_agent.ini
vi /etc/neutron/l3_agent.ini
在[DEFAULT]下添加,添加如下内容
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
6.配置DHCP代理编辑/etc/neutron/dhcp_agent.ini 文件
vi /etc/neutron/dhcp_agent.ini
在[DEFAULT]下添加
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
7.编辑/etc/neutron/metadata_agent.ini 文件
vi /etc/neutron/metadata_agent.ini
在[DEFAULT] 部分,添加如下内容
nova_metadata_ip = controller
metadata_proxy_shared_secret = 000000
8.编辑/etc/nova/nova.conf 文件
vi /etc/nova/nova.conf
在[neutron]部分,添加如下内容
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 000000
service_metadata_proxy = True
metadata_proxy_shared_secret = 000000
截图如下
6.网络服务初始化,同步数据库(在controller 节点执行)
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
截图如下
7.重启计算API服务(在controller 节点执行)
systemctl restart openstack-nova-api.service
8.启动网络服务并设置开机启动(在controller 节点执行)
systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service
systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service
截图如下
9.安装并配置neutron服务(在compute 节点执行)
1.下载软件
yum -y install openstack-neutron-linuxbridge ebtables ipset
2.编辑/etc/neutron/neutron.conf 文件
vi /etc/neutron/neutron.conf
在[DEFAULT]下添加
rpc_backend = rabbit
auth_strategy = keystone
在[oslo_messaging_rabbit]下添加
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 000000
在[keystone_authtoken]下添加
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 000000
在[oslo_concurrency]部分,添加如下内容
lock_path = /var/lib/neutron/tmp
部分截图如下
3.编辑/etc/neutron/plugins/ml2/linuxbridge_agent.ini 文件
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
在[linux_bridge]部分,添加如下内容
physical_interface_mappings = provider:eth1
在[vxlan]部分,添加如下内容
enable_vxlan = True
local_ip = 192.168.100.20
l2_population = True
在[securitygroup]部分,添加如下内容
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
部分截图如下
4.编辑/etc/nova/nova.conf 文件
vi /etc/nova/nova.conf
在[neutron]部分添加
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 000000
截图如下
10.重启服务并设置开机自启(在compute 节点执行)
systemctl restart openstack-nova-compute.service neutron-linuxbridge-agent.service
systemctl enable neutron-linuxbridge-agent.service
11.验证(在controller 节点执行)
. /root/admin-openrc
neutron ext-list
neutron agent-list
截图如下 (六)Open Stack(M)----Dashboard安装和配置
大家记得,不要忘记打快照哦!
感谢大家,点赞,收藏,关注,评论!
|