OpenStack 计算服务 Nova介绍和控制节点部署 (八)

一)nova在keystone上服务注册 

1.1创建nova务实体

[root@controller ~]# source admin-openrc

[root@controller ~]# openstack service create --name nova \
> --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | ef8e29299ab9413797952c01f30c45a7 |
| name | nova |
| type | compute |
+-------------+----------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne \
> compute public http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 2440e5576e994e6bb22326e52cb60587 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | ef8e29299ab9413797952c01f30c45a7 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne \
> compute internal http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | b2b525624a1e428aa673f38b2fa53542 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | ef8e29299ab9413797952c01f30c45a7 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne \
> compute admin http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 9507672587aa4cfaaa838f05ce4dcdb4 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | ef8e29299ab9413797952c01f30c45a7 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+

 

二)安装配置nova

2.1安装软件包

# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler -y

2.2 配置数据库

#vim /etc/nova/nova.conf


[DEFAULT]
enabled_apis = osapi_compute,metadata    #设置启用的元数据API
transport_url = rabbit://openstack:redhat@controller     #(消息队列配置)
auth_strategy = keystone
my_ip = 10.0.0.101
use_neutron = True                                        #启动网络服务支持和关闭防火墙
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[database]
connection = mysql+pymysql://nova:redhat@controller/nova      #配置nova数据库连接

[api_database]
connection = mysql+pymysql://nova:redhat@controller/nova_api   #配置nova-api数据库连接
 
[keystone_authtoken]                                         #配置keystone
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 = nova
password = redhat

[vnc]                                                   #配置VNC代理使用控制节点的管理接口IP地址
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip

[glance]                                               #配置镜像服务 API 的位置
api_servers = http://controller:9292

[oslo_concurrency]                                      #配置锁路径
lock_path = /var/lib/nova/tmp

 

2.3 同步数据库

su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova

提示:有警告可以忽略

 

2.4 设置开机启动,并启动服务

systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service

systemctl start openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service

 

2.5 查看控制节点是否配置成功

[root@controller ~]# openstack host list
+------------+-------------+----------+
| Host Name | Service | Zone |
+------------+-------------+----------+
| controller | consoleauth | internal |
| controller | conductor | internal |
| controller | scheduler | internal |
+------------+-------------+----------+

  

 

 

  

posted @ 2018-04-16 17:02  jimmy_xuli  阅读(213)  评论(0编辑  收藏  举报