Openstack — 计算节点配置

控制节点传送门:http://www.01wneo.xin/?p=383

黑色的粗字体,是需要执行的命令,其它的普通的字体是演示效果

Node2计算节点配置
#Base
mv /etc/yum.repos.d/CentOS-Base.repo{,.bak}
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install centos-release-openstack-pike -y 
yum install python-openstackclient openstack-selinux -y
yum install python-openstackclient python2-PyMySQL -y
yum install openstack-utils -y
#Nova
yum install -y openstack-nova-compute
yum install -y python-openstackclient openstack-selinux
#Neutron
yum install -y openstack-neutron-linuxbridge ebtables ipset
#Cinder
yum install -y openstack-cinder python-cinderclient targetcli python-oslo-policy
#Update Qemu
yum install -y centos-release-qemu-ev.noarch
yum install qemu-kvm qemu-img -y

修改nova.conf配置文件代码
#设置Nova实例路径,磁盘镜像文件;
Vdir=/var/lib/nova
VHD=$Vdir/instances
mkdir -p $VHD
chown -R nova:nova $Vdir
#使用QEMU或KVM ,KVM硬件加速需要硬件支持
[[ `egrep -c '(vmx|svm)' /proc/cpuinfo` = 0 ]] && { Kvm=qemu; } || { Kvm=kvm; }
echo "使用 $Kvm"
VncProxy=192.168.1.120 #VNC代理外网IP地址
# #nova配置
/usr/bin/cp /etc/nova/nova.conf{,.$(date +%s).bak}
#egrep -v '^$|#' /etc/nova/nova.conf
echo '#
[DEFAULT]
instances_path='$VHD'
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack@node1
my_ip = 192.168.1.121
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
connection = mysql+pymysql://nova:nova@node1/nova_api
[database]
connection = mysql+pymysql://nova:nova@node1/nova
[api]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://node1:5000
auth_url = http://node1:35357
memcached_servers = node1:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[vnc]
enabled = true
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://'$VncProxy':6080/vnc_auto.html
[glance]
api_servers = http://node1:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://node1:35357/v3
username = placement
password = placement
[libvirt]
virt_type = '$Kvm'
#'>/etc/nova/nova.conf
#sed -i 's#node1:6080#192.168.1.120:6080#' /etc/nova/nova.conf
#启动计算节点相关服务
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service

192.168.1.120-node1-控制节点查看
[root@node1 ~]# openstack host list
+-----------+-------------+----------+
| Host Name | Service | Zone |
+-----------+-------------+----------+
| node1 | consoleauth | internal |
| node1 | conductor | internal |
| node1 | scheduler | internal |
| node2 | compute | nova |
+-----------+-------------+----------+

Neutron计算节点配置
配置Neutron,命令执行如下
#配置
cp /etc/neutron/neutron.conf{,.bak}
echo '#
[DEFAULT]
auth_strategy = keystone
transport_url = rabbit://openstack:openstack@node1
[keystone_authtoken]
auth_uri = http://node1:5000
auth_url = http://node1:35357
memcached_servers = node1:11211
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = neutron
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
#'>/etc/neutron/neutron.conf
#
echo '
#
[neutron]
url = http://node1:9696
auth_url = http://node1:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
#'>>/etc/nova/nova.conf
#
cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,bak}
# ens32是网卡名
echo '
[linux_bridge]
physical_interface_mappings = provider:ens32
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = false
# local_ip = 192.168.1.121
# l2_population = true
#'>/etc/neutron/plugins/ml2/linuxbridge_agent.ini
#重启相关服务
systemctl restart openstack-nova-compute.service
#启动neutron
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service

192.168.1.120-node1-控制节点查看
[root@node1 ~]# openstack network agent list
+--------------------------------------+--------------------+-------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+-------+-------------------+-------+-------+---------------------------+
| 36d02007-763b-4d43-9ee4-28f16976d127 | Linux bridge agent | node2 | None | :-) | UP | neutron-linuxbridge-agent |
| 611b8c89-2ad2-42b3-bf12-cf97a2fa459d | Linux bridge agent | node1 | None | :-) | UP | neutron-linuxbridge-agent |
| 9905b95b-09b0-4a37-9f46-2d428012834c | DHCP agent | node1 | nova | :-) | UP | neutron-dhcp-agent |
| a80707f8-bc06-4053-85c4-7bf433b3a24e | Metadata agent | node1 | None | :-) | UP | neutron-metadata-agent |
+--------------------------------------+--------------------+-------+-------------------+-------+-------+---------------------------+

 

发表评论

zh_CNChinese
zh_CNChinese