compute节点系统配置
- hostname
hostnamectl --static set-hostname compute1
- hosts
cat >> /etc/hosts << OFF
# controller
10.0.0.11 controller
# network
10.0.0.21 network
# compute1
10.0.0.31 compute1
OFF
安装软件源
yum -y install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
yum -y install http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm
升级系统软件包(升级完重启查看系统配置)
yum upgrade
reboot
#hostname
compute1
cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
- 安装openstack-selinux和openstack-utils
yum -y install openstack-selinux openstack-utils
ntp
安装软件包
yum -y install ntp
修改配置文件
sed -i 's/server 0.centos.pool.ntp.org iburst/#server 0.centos.pool.ntp.org iburst/g' /etc/ntp.conf
sed -i 's/server 1.centos.pool.ntp.org iburst/#server 1.centos.pool.ntp.org iburst/g' /etc/ntp.conf
sed -i 's/server 2.centos.pool.ntp.org iburst/#server 2.centos.pool.ntp.org iburst/g' /etc/ntp.conf
sed -i 's/server 3.centos.pool.ntp.org iburst/#server 3.centos.pool.ntp.org iburst/g' /etc/ntp.conf
echo "server controller iburst" >>/etc/ntp.conf
启动ntp并设置开机启动
systemctl enable ntpd.service
systemctl restart ntpd.service
安装nova
- 安装软件包
yum -y install openstack-nova-compute sysfsutils
查看主机是否支持虚拟化
egrep -c '(vmx|svm)' /proc/cpuinfo
1
若是1,支持,nova配置文件中,virt_type选择kvm
若是0,不支持,nova配置文件中,virt_type选择qemu
- 修改配置文件nova.conf
openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host controller
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password RABBIT_PASS
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_plugin password
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken password nova
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.31
openstack-config --set /etc/nova/nova.conf DEFAULT vnc_enabled True
openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0
openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.0.0.31
openstack-config --set /etc/nova/nova.conf DEFAULT novncproxy_base_url http://controller:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf glance host controller
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lock/nova
openstack-config --set /etc/nova/nova.conf DEFAULT verbose True
openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm
启动nova并设置开机启动
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service
验证服务
控制节点执行命令
- 变量
echo "export OS_REGION_NAME=RegionOne" >> admin-openrc.sh
source admin-openrc.sh
- service
nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1 | nova-consoleauth | controller | internal | enabled | up | 2015-09-12T01:16:12.000000 | - |
| 2 | nova-conductor | controller | internal | enabled | up | 2015-09-12T01:16:12.000000 | - |
| 3 | nova-cert | controller | internal | enabled | up | 2015-09-12T01:16:12.000000 | - |
| 4 | nova-scheduler | controller | internal | enabled | up | 2015-09-12T01:16:12.000000 | - |
| 5 | nova-compute | compute1 | nova | enabled | up | 2015-09-12T01:16:11.000000 | - |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
- endpoint
nova endpoints
+-----------+------------------------------------------------------------+
| nova | Value |
+-----------+------------------------------------------------------------+
| id | 8e02a81594914ee68ec2a4c348f36e86 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:8774/v2/6655a8db1705461384c78137e5e87c17 |
+-----------+------------------------------------------------------------+
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | b7c9400288844a64aac66688225ef94f |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:5000/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 1bf9b3094cf0440cadfcfe01d8d48ff0 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:9292 |
+-----------+----------------------------------+
- image-list
nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| 476d7b76-57d8-48be-a7e0-2130e718f157 | cirros-0.3.4-x86_64 | ACTIVE | |
+--------------------------------------+---------------------+--------+--------+