注意此处的bug,参考o版
官网地址 https://docs.openstack.org/nova/stein/install/controller-install-rdo.html 控制端配置 #:创建库,并授权 MariaDB [(none)]> CREATE DATABASE nova_api; Query OK, 1 row affected (0.000 sec) MariaDB [(none)]> CREATE DATABASE nova; Query OK, 1 row affected (0.001 sec) MariaDB [(none)]> CREATE DATABASE nova_cell0; Query OK, 1 row affected (0.000 sec) MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO ‘nova‘@‘%‘ -> IDENTIFIED BY ‘nova123‘; Query OK, 0 rows affected (0.000 sec) MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘%‘ -> IDENTIFIED BY ‘nova123‘; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO ‘nova‘@‘%‘ -> IDENTIFIED BY ‘nova123‘; Query OK, 0 rows affected (0.001 sec) #:加载环境变量 [root@cobbler ~]# source scripts/admin-stein.sh #:创建nova用户 [root@cobbler ~]# openstack user create --domain default --password-prompt nova #:为admin项目添加一个用户nova,并添加到service角色 [root@cobbler ~]# openstack role add --project service --user nova admin #:创建一个类型为compute的service [root@cobbler ~]# openstack service create --name nova --description "OpenStack Compute" compute #:注册API [root@cobbler ~]# openstack endpoint create --region RegionOne compute public http://www.magedu.net:8774/v2.1 [root@cobbler ~]# openstack endpoint create --region RegionOne compute internal http://www.magedu.net:8774/v2.1 [root@cobbler ~]# openstack endpoint create --region RegionOne compute admin http://www.magedu.net:8774/v2.1 #:安装nova 服务(注意此版本有bug,少安装了一个包) [root@cobbler ~]# yum install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-console -y #:配置nova [root@cobbler ~]# vim /etc/nova/nova.conf [DEFAULT] # enabled_apis = osapi_compute,metadata [api_database] # connection = mysql+pymysql://nova:nova123@www.magedu.net/nova_api [database] # connection = mysql+pymysql://nova:nova123@www.magedu.net/nova [DEFAULT] # transport_url = rabbit://openstack:openstack123@www.magedu.net [api] # auth_strategy = keystone [keystone_authtoken] # auth_url = http://www.magedu.net:5000/v3 memcached_servers = www.magedu.net:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = nova [DEFAULT] # use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriverus [vnc] # enabled = true # ... server_listen = 192.168.7.101
server_proxyclient_address = 192.168.7.101 [glance] # Configuration options for the Image service api_servers = http://www.magedu.net: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://www.magedu.net:5000/v3 username = placement password = placement [root@cobbler ~]# vim /etc/httpd/conf.d/00-placement-api.conf #:注意此处是Bug,参照o版 <Directory /usr/bin> <IfVersion >= 2.4> Require all granted </IfVersion> <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> </Directory> #: 重启httpd服务 [root@cobbler ~]# systemctl restart httpd #:修改haproxy配置文件 [root@cobbler ~]# vim /etc/haproxy/haproxy.cfg listen rabbitmq bind 192.168.7.101:5672 mode tcp server rabbit 192.168.7.105:5672 check inter 2s fall 3 rise 5 #:重启服务 [root@cobbler ~]# systemctl restart haproxy #:初始化数据库 [root@cobbler ~]# su -s /bin/sh -c "nova-manage api_db sync" nova [root@cobbler ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova [root@cobbler ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova 227880ce-d791-41ec-8e37-2177d81b4568 [root@cobbler ~]# su -s /bin/sh -c "nova-manage db sync" nova /usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u‘Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is deprecated and will be disallowed in a future release‘) result = self._query(query) /usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u‘Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release‘) result = self._query(query) [root@cobbler ~]# su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova #:启动服务 [root@cobbler ~]# systemctl enable openstack-nova-api.service openstack-nova-consoleauth openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service [root@cobbler ~]# systemctl start openstack-nova-api.service openstack-nova-consoleauth openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
官网地址 https://docs.openstack.org/nova/stein/install/compute-install-rdo.html 计算节点配置 #:安装包 [root@node1 ~]# yum install openstack-nova-compute -y #:配置 [root@node1 ~]# vim /etc/nova/nova.conf [DEFAULT] # enabled_apis = osapi_compute,metadata transport_url = rabbit://openstack:openstack123@www.magedu.net [api] # auth_strategy = keystone [keystone_authtoken] # auth_url = http://www.magedu.net:5000/v3 memcached_servers = www.magedu.net:11211 auth_type = password project_domain_name = Default user_domain_name = Default project_name = service username = nova password = nova [DEFAULT] # use_neutron = true firewall_driver = nova.virt.firewall.NoopFirewallDriver [vnc] # enabled = true server_listen = 0.0.0.0 server_proxyclient_address = 192.168.7.103 novncproxy_base_url = http://www.magedu.net:6080/vnc_auto.html [glance] api_servers = http://www.magedu.net:9292 [placement] # region_name = RegionOne project_domain_name = Default project_name = service auth_type = password user_domain_name = Default auth_url = http://www.magedu.net:5000/v3 username = placement password = placement #:查看支不支持虚拟化 [root@node1 ~]# egrep -c ‘(vmx|svm)‘ /proc/cpuinfo #:解析主机 [root@node1 ~]# vim /etc/hosts 192.168.7.101 www.magedu.net #:启动服务 [root@node1 ~]# systemctl enable libvirtd.service openstack-nova-compute.service [root@node1 ~]# systemctl start libvirtd.service openstack-nova-compute.service
#:在控制节点加载变量 [root@cobbler ~]# source scripts/admin-stein.sh #:测试 [root@cobbler ~]# openstack compute service list --service nova-compute
#:发现主机
[root@cobbler ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova #:调一下 [root@cobbler ~]# vim /etc/nova/nova.conf discover_hosts_in_cells_interval=60
官网地址 https://docs.openstack.org/nova/stein/install/verify.html 测试 #导入变量 [root@cobbler ~]# source scripts/admin-stein.sh #:测试 [root@cobbler ~]# openstack compute service list [root@cobbler ~]# openstack catalog list [root@cobbler ~]# openstack image list [root@cobbler ~]# nova-status upgrade check
注意此版本的bug
OpenStack之七: compute服务(端口8774)
原文:https://www.cnblogs.com/maxuebin/p/11438144.html