问题导读
1.本文配置需要注意哪些问题?
2.libvirt什么情况下由QEMU 代替KVM?
3.MANAGEMENT_INTERFACE_IP_ADDRESS代表的含义是什么?
安装 和 配置控制节点
配置准备
1.创建数据库,完成下面内容
a.作为root登录mysql
[mw_shl_code=bash,true]mysql -u root -p[/mw_shl_code]
b.创建nova数据库
[mw_shl_code=bash,true]CREATE DATABASE nova;[/mw_shl_code]
c.授权访问nova数据库
[mw_shl_code=bash,true]GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';[/mw_shl_code]
NOVA_DBPASS替换为自己的密码
d.退出数据库
[mw_shl_code=bash,true]exit[/mw_shl_code]
2.生效admin用户名
[mw_shl_code=bash,true] source admin-openrc.sh[/mw_shl_code]
3.创建keystone认证,完成下面内容
a.创建nova用户
[mw_shl_code=bash,true]openstack user create --password-prompt nova[/mw_shl_code]
b.添加admin 角色到nova用户
[mw_shl_code=bash,true]openstack role add --project service --user nova admin[/mw_shl_code]
c.创建nova 服务实例
[mw_shl_code=bash,true] openstack service create --name nova \
--description "OpenStack Compute" compute[/mw_shl_code]
4.创建nova 服务 API endpoint:
[mw_shl_code=bash,true]openstack endpoint create \
--publicurl http://controller:8774/v2/%\(tenant_id\)s \
--internalurl http://controller:8774/v2/%\(tenant_id\)s \
--adminurl http://controller:8774/v2/%\(tenant_id\)s \
--region RegionOne \
compute[/mw_shl_code]
安装配置计算控制节点组件【控制节点】
1.安装nova
[mw_shl_code=bash,true]apt-get install nova-api nova-cert nova-conductor nova-consoleauth \
nova-novncproxy nova-scheduler python-novaclient -y[/mw_shl_code]
2.修改配置/etc/nova/nova.conf文件,完成下面内容
a.添加[database] 部分,配置数据库连接
[mw_shl_code=bash,true][database]
...
connection = mysql://nova:NOVA_DBPASS@controller/nova[/mw_shl_code]
记得密码替换为自己设置密码,这是mysql的密码,并非nova用户的密码
b.在[DEFAULT] 和 [oslo_messaging_rabbit] 部分,配置RabbitMQ 消息队列访问
[mw_shl_code=bash,true][DEFAULT]
...
rpc_backend = rabbit
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS[/mw_shl_code]这里的密码跟前面设置需要一致,这里使用的是RABBIT_PASS
c. 在[DEFAULT] 和 [keystone_authtoken] 部分,Identity service 访问:
[mw_shl_code=bash,true][DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = NOVA_PASS[/mw_shl_code]
NOVA_PASS替换为自己的密码,这里设置的密码为123
[mw_shl_code=bash,true]auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = 123 [/mw_shl_code]
注释或则删除在 [keystone_authtoken] 部分的选项.
d.在 [DEFAULT] 部分,使用控制节点管理网络ip地址配置my_ip
[mw_shl_code=bash,true][DEFAULT]
...
my_ip = 10.0.0.11[/mw_shl_code]
e.在 [DEFAULT]部分,使用控制节点管理网络ip地址配置 VNC proxy
[mw_shl_code=bash,true][DEFAULT]
...
vncserver_listen = 10.0.0.11
vncserver_proxyclient_address = 10.0.0.11[/mw_shl_code]
f.在 [glance] 部分, 配置镜像服务位置
[mw_shl_code=bash,true][glance]
...
host = controller[/mw_shl_code]
g.在 [oslo_concurrency]部分,配置 lock 路径:
[mw_shl_code=bash,true][oslo_concurrency]
...
lock_path = /var/lib/nova/tmp[/mw_shl_code]
h.在[DEFAULT]部分启用日志信息详细记录
[mw_shl_code=bash,true][DEFAULT]
...
verbose = True[/mw_shl_code]
3.同步数据库
[mw_shl_code=bash,true] su -s /bin/sh -c "nova-manage db sync" nova[/mw_shl_code]
遇到No handlers could be found for logger "oslo_config.cfg"
下面有解决办法
完成安装
1.重启计算服务
[mw_shl_code=bash,true] service nova-api restart
service nova-cert restart
service nova-consoleauth restart
service nova-scheduler restart
service nova-conductor restart
service nova-novncproxy restart[/mw_shl_code]
2.如果存在SQLite 数据库,则删除
[mw_shl_code=bash,true]rm -f /var/lib/nova/nova.sqlite[/mw_shl_code]
##############################################
安装配置【计算节点】
1.安装nova
[mw_shl_code=bash,true]apt-get install nova-compute sysfsutils -y[/mw_shl_code]
2.编辑文件 /etc/nova/nova.conf完成下面内容
a.在 [DEFAULT] 和 [oslo_messaging_rabbit]部分,配置RabbitMQ 消息队列服务
[mw_shl_code=bash,true][DEFAULT]
...
rpc_backend = rabbit
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS[/mw_shl_code]
替换为自己的设置密码RABBIT_PASS
b.在 [DEFAULT] 和 [keystone_authtoken] 部分, 配置 Identity service 访问:
[mw_shl_code=bash,true][DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = NOVA_PASS[/mw_shl_code]
NOVA_PASS 替换为自己设置密码。这里为123
注意:在 [keystone_authtoken] 部分,注释掉或移除其它内容.
c.在[DEFAULT] 部分,配置my_ip 选项
[mw_shl_code=bash,true][DEFAULT]
...
my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS[/mw_shl_code]
MANAGEMENT_INTERFACE_IP_ADDRESS这里是计算节点管理网络ip地址 10.0.0.31
d. 在[DEFAULT]部分,启用和配置remote console 访问:
[mw_shl_code=bash,true][DEFAULT]
...
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = MANAGEMENT_INTERFACE_IP_ADDRESS
novncproxy_base_url = http://controller:6080/vnc_auto.html[/mw_shl_code]
MANAGEMENT_INTERFACE_IP_ADDRESS替换为计算节点管理网络ip地址这里是10.0.0.31
注意:如果通过浏览器访问,不能解析hostname controller ,则使用管理网络ip,代替controller
e.在[glance]部分,配置glance服务位置
[mw_shl_code=bash,true][glance]
...
host = controller[/mw_shl_code]
f.在[oslo_concurrency] 部分, 配置 lock 路径:
[mw_shl_code=bash,true][oslo_concurrency]
...
lock_path = /var/lib/nova/tmp[/mw_shl_code]
g.启用日志详细信息记录
[mw_shl_code=bash,true][DEFAULT]
...
verbose = True[/mw_shl_code]
完成安装
1.决定计算节点是否支持虚拟机的硬件加速:
[mw_shl_code=bash,true]egrep -c '(vmx|svm)' /proc/cpuinfo[/mw_shl_code]
如果输出值是1或则比这更大,则不需要额外配置
如果是0,计算节点不支持硬件加速,你必须配置libvirt 为QEMU ,代替KVM
a. 编辑文件/etc/nova/nova-compute.conf在 [libvirt]
[mw_shl_code=bash,true][libvirt]
...
virt_type = qemu[/mw_shl_code]
2.重启计算服务
[mw_shl_code=bash,true]service nova-compute restart[/mw_shl_code]
3.如果存在SQLite 数据,则删除
[mw_shl_code=bash,true] rm -f /var/lib/nova/nova.sqlite[/mw_shl_code]
验证安装【控制节点】
1.生效环境变量
[mw_shl_code=bash,true]source admin-openrc.sh[/mw_shl_code]
2.目录服务组件来验证每个进程的成功创建和注册:
[mw_shl_code=bash,true]nova service-list[/mw_shl_code]
[mw_shl_code=bash,true]+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1 | nova-conductor | controller | internal | enabled | up | 2014-09-16T23:54:02.000000 | - |
| 2 | nova-consoleauth | controller | internal | enabled | up | 2014-09-16T23:54:04.000000 | - |
| 3 | nova-scheduler | controller | internal | enabled | up | 2014-09-16T23:54:07.000000 | - |
| 4 | nova-cert | controller | internal | enabled | up | 2014-09-16T23:54:00.000000 | - |
| 5 | nova-compute | compute1 | nova | enabled | up | 2014-09-16T23:54:06.000000 | - |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+[/mw_shl_code]
这个输出显示四个服务在控制节点启用,一个服务在计算节点
3.列出API endpoints 在 Identity service核实身份验证连接服务
这是官网给出的,似乎有问题。
[mw_shl_code=bash,true]nova endpoints[/mw_shl_code]
[mw_shl_code=bash,true]
+-----------+------------------------------------------------------------+
| nova | Value |
+-----------+------------------------------------------------------------+
| id | 1fb997666b79463fb68db4ccfe4e6a71 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:8774/v2/ae7a98326b9c455588edd2656d723b9d |
+-----------+------------------------------------------------------------+
+-----------+------------------------------------------------------------+
| nova | Value |
+-----------+------------------------------------------------------------+
| id | bac365db1ff34f08a31d4ae98b056924 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:8774/v2/ae7a98326b9c455588edd2656d723b9d |
+-----------+------------------------------------------------------------+
+-----------+------------------------------------------------------------+
| nova | Value |
+-----------+------------------------------------------------------------+
| id | e37186d38b8e4b81a54de34e73b43f34 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:8774/v2/ae7a98326b9c455588edd2656d723b9d |
+-----------+------------------------------------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 41ad39f6c6444b7d8fd8318c18ae0043 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 50ecc4ce62724e319f4fae3861e50f7d |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 7d3df077a20b4461a372269f603b7516 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | 88150c2fdc9d406c9b25113701248192 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:5000/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | cecab58c0f024d95b36a4ffa3e8d81e1 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:5000/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | fc90391ae7cd4216aca070042654e424 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:35357/v2.0 |
+-----------+----------------------------------+[/mw_shl_code]
在修改了admin-openrc.sh会返回如下内容:
[mw_shl_code=bash,true]+-----------+------------------------------------------------------------+
| nova | Value |
+-----------+------------------------------------------------------------+
| id | 01200ef9404b4498984ffd64a1632787 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:8774/v2/0505899607a742ccbc98541d896e6437 |
+-----------+------------------------------------------------------------+
+-----------+----------------------------------+
| keystone | Value |
+-----------+----------------------------------+
| id | 4811552dd697443cb6627ace8ee5fa2d |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:5000/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 03165d89ee154452a9fad0d4df876bc4 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| neutron | Value |
+-----------+----------------------------------+
| id | 180db82ef2db4946b9872af0b1743bd7 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://controller:9696 |
+-----------+----------------------------------+[/mw_shl_code]
4.列出 镜像 在 Image service 目录验证连接 Image service:
[mw_shl_code=bash,true]nova image-list[/mw_shl_code]
[mw_shl_code=bash,true]+--------------------------------------+---------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros-0.3.3-x86_64 | ACTIVE | |
+--------------------------------------+---------------------+--------+--------+[/mw_shl_code]
###########################################
遇到问题:
su -s /bin/sh -c "nova-manage db sync" nova
No handlers could be found for logger "oslo_config.cfg"
原因:
日志文件的配置项错误
解决办法:
修改logdir为log_dir=/var/log/nova
————————————————————————————————————
ERROR (EndpointNotFound): publicURL endpoint for compute service not found
原先endpoint被删除了
创建后:
总结:
在删除service的时候,endpoint会自动删除。他们之间是级联删除的
————————————————————————————————————
WARNING: nova has no endpoint in ! Available endpoints for this service:
此警告不影响安装,可以忽略
相关内容
openstack【Kilo】入门 【准备篇】零:整体介绍
openstack【Kilo】入门 【准备篇】一: Ubuntu14.04远程连接(ssh安装)
openstack【Kilo】入门 【准备篇】二:NTP安装
openstack【Kilo】入门 【准备篇】三:mysql(MariaDB)安装【控制节点】
openstack【Kilo】入门 【准备篇】四:RabbitMQ 安装
openstack【Kilo】入门 【keystone篇】五:keystone安装与配置
openstack【Kilo】入门 【keystone篇】六:创建服务实例和 API endpoint
openstack【Kilo】入门 【keystone篇】七:创建租户、用户、角色
openstack【Kilo】入门 【keystone篇】八:验证keystone安装部署
openstack【Kilo】入门 【keystone篇】九: 创建openstack客户端环境变量脚本
openstack【Kilo】入门 【glance篇】十:glance安装配置【控制节点】
openstack【Kilo】入门 【glance篇】十一:glance安装验证
openstack【Kilo】入门 【nova篇】十二:安装配置nova
openstack【Kilo】入门 【网络篇】十三:安装配置【控制节点】
openstack【Kilo】入门 【网络篇】十四:安装配置【网络节点】
openstack【Kilo】入门 【网络篇】十五:安装配置【计算节点】
openstack【Kilo】入门 【网络篇】十六:实例化网络
openstack【Kilo】入门 【网络篇】十七:创建实例
|
|