OpenStack-Queens详细安装部署(八)计算节点-Nova+Neutron+Cinder

  • A+
所属分类:OpenStack

一、Nova计算节点

1. 安装nova-compute (所有compute节点)

[root@DT_Node-172_17_7_4 ~]# yum install python-openstackclient openstack-utils openstack-selinux -y
[root@DT_Node-172_17_7_4 ~]# yum install openstack-nova-compute -y

2. 配置nova.conf (所有compute节点)

# 注意”my_ip”参数,根据节点修改;
# 注意nova.conf文件的权限:root:nova
[root@DT_Node-172_17_7_4 ~]# cp /etc/nova/nova.conf{,_original}
[root@DT_Node-172_17_7_4 ~]# egrep -v "^$|^#" /etc/nova/nova.conf 
[DEFAULT]
my_ip=172.17.7.4
use_neutron=true
firewall_driver=nova.virt.firewall.NoopFirewallDriver
enabled_apis=osapi_compute,metadata
transport_url=rabbit://openstack:MWY1NTA5NGYzYmM1MWQ2MTFk@controller1:5672,openstack:MWY1NTA5NGYzYmM1MWQ2MTFk@controller2:5672,openstack:MWY1NTA5NGYzYmM1MWQ2MTFk@controller3:5672
[api]
auth_strategy=keystone
[api_database]
auth_strategy = keystone
[api_database]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller1:11211,controller2:11211,controller3:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = ZTQ0NTdjOTI1YzY1Zjg2ZTE2
[barbican]
[cache]
[cells]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[crypto]
[database]
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers=http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller1:11211,controller2:11211,controller3:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = MzkwOWI1Nzc3Mzg5NTg2MTk4
[libvirt]
virt_type=kvm
inject_password=True
inject_key=True
inject_partition=-1
cpu_mode=host-model
vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver
hw_machine_type = x86_64=pc-i440fx-rhel7.2.0
[matchmaker_redis]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
os_region_name=RegionTest
auth_type=password
auth_url=http://controller:35357/v3
project_name=service
project_domain_name=Default
username=placement
user_domain_name=Default
password=ZTQ0NTdjOTI1YzY1Zjg2ZTE2
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled=true
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=$my_ip
novncproxy_base_url=http://172.17.7.100:6080/vnc_auto.html
[workarounds]
[wsgi]
[xenserver]
[xvp]

3. 启动服务 (所有compute节点)

# 开机启动
[root@DT_Node-172_17_7_4 ~]# systemctl enable libvirtd.service openstack-nova-compute.service
# 启动
[root@DT_Node-172_17_7_4 ~]# systemctl restart libvirtd.service openstack-nova-compute.service
查看状态
[root@DT_Node-172_17_7_4 ~]# systemctl status libvirtd.service openstack-nova-compute.service

OpenStack-Queens详细安装部署(八)计算节点-Nova+Neutron+Cinder

4. 向cell数据库添加计算节点 (任意controller节点操作)

[root@DT_Node-172_17_7_1 ~]# . keystone_admin
# 确认数据库中含有主机
[openstack-admin]-[root@DT_Node-172_17_7_1 ~]# openstack compute service list --service nova-compute

OpenStack-Queens详细安装部署(八)计算节点-Nova+Neutron+Cinder

1)手工发现计算节点

# 手工发现计算节点主机,即添加到cell数据库
[openstack-admin]-[root@DT_Node-172_17_7_1 ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

OpenStack-Queens详细安装部署(八)计算节点-Nova+Neutron+Cinder

2)自动发现计算节点 (所有controller节点操作)

# 为避免新加入计算节点时,手动执行注册操作”nova-manage cell_v2 discover_hosts”,可设置控制节点定时自动发现主机;
# 涉及控制节点nova.conf文件的[scheduler]字段;
# 如下设置自动发现时间为5min,可根据实际环境调节
[root@DT_Node-172_17_7_1 ~]# vim /etc/nova/nova.conf
[scheduler]
discover_hosts_in_cells_interval=300
# 重启nova服务,配置生效
[root@controller01 ~]# systemctl restart openstack-nova-api.service

5. 验证
登陆dashboard,管理员-->计算-->虚拟机管理器
OpenStack-Queens详细安装部署(八)计算节点-Nova+Neutron+Cinder
如果已注册成功,在"虚拟机管理器"标签下可发现计算节点,并能展示出各计算节点的资源;如果未注册或注册失败,则"虚拟机管理器"标签下无主机。

二、Neutron计算节点
1. 安装neutron-linuxbridge (所有compute节点)

[root@DT_Node-172_17_7_4 ~]# yum install openstack-neutron-linuxbridge ebtables ipset -y

2. 配置neutron.conf

# 注意”bind_host”参数,根据节点修改;
# 注意neutron.conf文件的权限:root:neutron
[root@DT_Node-172_17_7_4 ~]# cp /etc/neutron/neutron.conf{,_original}
[root@DT_Node-172_17_7_4 ~]# egrep -v "^$|^#" /etc/neutron/neutron.conf
[DEFAULT]
state_path = /var/lib/neutron
bind_host = 172.17.7.4
auth_strategy = keystone
transport_url=rabbit://openstack:MWY1NTA5NGYzYmM1MWQ2MTFk@controller1:5672,openstack:MWY1NTA5NGYzYmM1MWQ2MTFk@controller2:5672,openstack:MWY1NTA5NGYzYmM1MWQ2MTFk@controller3:5672
[agent]
[cors]
[database]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller1:11211,controller2:11211,controller3:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = MzkwOWI1Nzc3Mzg5NTg2MTk4
[matchmaker_redis]
[nova]
[oslo_concurrency]
lock_path = $state_path/lock
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[quotas]
[ssl]
[root@DT_Node-172_17_7_4 ~]# 

3. 配置linuxbridge_agent.ini
1)配置linuxbridgr_agent.ini (所有compute节点)

# linuxbridge_agent.ini文件的权限:root:neutron
[root@DT_Node-172_17_7_4 ~]# cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,_original} 
[root@DT_Node-172_17_7_4 ~]# egrep -v "^$|^#" /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[DEFAULT]
[agent]
[linux_bridge]
physical_interface_mappings = vlan:eth1
[network_log]
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = false
local_ip = 10.0.0.41
l2_population = true 
[root@DT_Node-172_17_7_4 ~]#

2)配置内核参数 (所有compute节点)

# bridge:是否允许桥接;
# 如果“sysctl -p”加载不成功,报” No such file or directory”错误,需要加载内核模块“br_netfilter”;
# 命令“modinfo br_netfilter”查看内核模块信息;
# 命令“modprobe br_netfilter”加载内核模块
[root@DT_Node-172_17_7_4 ~]# echo "# bridge
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1" >> /etc/sysctl.conf
[root@DT_Node-172_17_7_4 ~]# sysctl -p 

4. 配置nova.conf (所有compute节点)

# 配置只涉及nova.conf的”[neutron]”字段
[root@DT_Node-172_17_7_4 ~]# vim /etc/nova/nova.conf
[neutron]
url=http://controller:9696
auth_type=password
auth_url=http://controller:35357
region_name=RegionTest
project_name=service
project_domain_name=default
username=neutron
user_domain_name=default
password=MzkwOWI1Nzc3Mzg5NTg2MTk4

5. 启动服务 (所有compute节点)

# nova.conf文件已变更,首先需要重启全部计算节点的nova服务
[root@DT_Node-172_17_7_4 ~]# systemctl restart openstack-nova-compute.service
# 开机启动
[root@DT_Node-172_17_7_4 ~]# systemctl enable neutron-linuxbridge-agent.service
# 启动
[root@DT_Node-172_17_7_4 ~]# systemctl restart neutron-linuxbridge-agent.service

6. 验证 (任意controller节点操作)

[root@DT_Node-172_17_7_1 ~]# . keystone_admin
# 查看neutron相关的agent;
# 或:openstack network agent list --agent-type linux-bridge
[openstack-admin]-[root@DT_Node-172_17_7_1 ~]# openstack network agent list

OpenStack-Queens详细安装部署(八)计算节点-Nova+Neutron+Cinder

三、Cinder
yum install -y openstack-cinder targetcli python-keystone

lookback

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: