[gsl@controller ~]$ openstack service create --name keystone --description "OpenStack Identity" identity
An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-6f8c5f03-4ee1-494e-9cd1-3d86db0c5df5)
日志信息
[root@controller ~]# tail -f /var/log/keystone/keystone.log
2017-12-05 10:43:23.791 1176 ERROR keystone.common.wsgi ProgrammingError: (pymysql.err.ProgrammingError) (1146, u"Table 'keystone.service' doesn't exist") [SQL: u'INSERT INTO service (id, type, enabled, extra) VALUES (%(id)s, %(type)s, %(enabled)s, %(extra)s)'] [parameters: {'type': u'identity', 'enabled': 1, 'id': '8b12e86660644af092018fb301b3d3cc', 'extra': '{"description": "OpenStack Identity", "name": "keystone"}'}]
2017-12-05 10:43:23.791 1176 ERROR keystone.common.wsgi
处理
[root@controller ~]# keystone-manage db_sync
再执行
[gsl@controller ~]$ openstack service create --name keystone --description "OpenStack Identity" identity
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Identity |
| enabled | True |
| id | 0a726b6de76547d7be6ea7716d6fdb6d |
| name | keystone |
| type | identity |
+-------------+----------------------------------+
[gsl@controller ~]$ openstack image create "cirros" \
> --file cirros-0.3.5-x86_64-disk.img \
> --disk-format qcow2 --container-format bare \
> --public
[root@controller glance]# tail api.log
2017-12-05 17:26:34.100 2139 INFO eventlet.wsgi.server [req-f13a0aa2-0814-4457-b173-391da738451f 73b048955ccf40f0b28dbd5f388b0901 a3f9b68bb68042abbe1b53131c31fe74 - 2806de7ce26d448d809b82cda6afdfac 2806de7ce26d448d809b82cda6afdfac] 10.0.0.11 - - [05/Dec/2017 17:26:34] "GET /v2/schemas/image HTTP/1.1" 200 4357 0.675650
2017-12-05 17:26:34.318 2139 WARNING oslo_db.sqlalchemy.engines [req-53e3d296-72f6-4665-94aa-27940689ccd6 73b048955ccf40f0b28dbd5f388b0901 a3f9b68bb68042abbe1b53131c31fe74 - 2806de7ce26d448d809b82cda6afdfac 2806de7ce26d448d809b82cda6afdfac] URL mysql://glance:***@localhost/glance does not contain a '+drivername' portion, and will make use of a default driver. A full dbname+drivername:// protocol is recommended. For MySQL, it is strongly recommended that mysql+pymysql:// be specified for maximum service compatibility
2017-12-05 17:26:34.335 2139 ERROR glance.common.wsgi [req-53e3d296-72f6-4665-94aa-27940689ccd6 73b048955ccf40f0b28dbd5f388b0901 a3f9b68bb68042abbe1b53131c31fe74 - 2806de7ce26d448d809b82cda6afdfac 2806de7ce26d448d809b82cda6afdfac] Caught error: (_mysql_exceptions.OperationalError) (1045, "Access denied for user 'glance'@'localhost' (using password: YES)"): OperationalError: (_mysql_exceptions.OperationalError) (1045, "Access denied for user 'glance'@'localhost' (using password: YES)")
数据库拒绝访问,查看配置,编辑文件 /etc/glance/glance-api.conf
[database]
...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
这一项漏加,添加后,重新执行
# su -s /bin/sh -c "glance-manage db_sync" glance
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:1328: OsloDBDeprecationWarning: EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade
expire_on_commit=expire_on_commit, _conf=conf)
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> liberty, liberty initial
INFO [alembic.runtime.migration] Running upgrade liberty -> mitaka01, add index on created_at and updated_at columns of 'images' table
INFO [alembic.runtime.migration] Running upgrade mitaka01 -> mitaka02, update metadef os_nova_server
INFO [alembic.runtime.migration] Running upgrade mitaka02 -> ocata01, add visibility to and remove is_public from images
INFO [alembic.runtime.migration] Running upgrade ocata01 -> pike01, drop glare artifacts tables
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Upgraded database to: pike01, current revision(s): pike01
重新验证操作
[gsl@controller ~]$ openstack image create "cirros" \
> --file cirros-0.3.5-x86_64-disk.img \
> --disk-format qcow2 --container-format bare \
> --public
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | f8ab98ff5e73ebab884d80c9dc9c7290 |
| container_format | bare |
| created_at | 2017-12-05T10:58:58Z |
| disk_format | qcow2 |
| file | /v2/images/9df2e55e-b7e8-46b0-89f6-01a97deed3a5/file |
| id | 9df2e55e-b7e8-46b0-89f6-01a97deed3a5 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros |
| owner | a3f9b68bb68042abbe1b53131c31fe74 |
| protected | False |
| schema | /v2/schemas/image |
| size | 13267968 |
| status | active |
| tags | |
| updated_at | 2017-12-05T10:58:59Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+
按照官方文档的要求进行的安装,出现这个问题
[root@compute1 yum.repos.d]# yum install openstack-nova-compute
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
No package openstack-nova-compute available.
Error: Nothing to do
解决办法:
先安装centos-release-openstack-pike,这个包应该是先决条件,其他节点安装也遇到同样问题,官方文档没有看到,后安装openstack-nova-compute
yum install centos-release-openstack-pike.x86_64
yum update
yum install openstack-nova-compute
日志信息
cat /var/log/nova/nova-compute.log
2017-12-06 19:11:12.267 32658 ERROR nova (class_id, method_id), ConnectionError)
2017-12-06 19:11:12.267 32658 ERROR nova AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
broker logfile显示openstack用户没有认证信息,
[root@controller ~]cat /var/log/nova/nova-api.log
重新添加认证信息
[root@controller ~]# rabbitmqctl list_user_permissions
Error: list_user_permissions expects a username argument, but none provided.
[root@controller ~]# rabbitmqctl list_user_permissions openstack
Listing permissions for user "openstack" ...
Error: {error,{no_such_user,<<"openstack">>}}
[root@controller ~]# rabbitmqctl add_user openstack *****
Creating user "openstack" ...
[root@controller ~]# rabbitmqctl list_user_permissions openstack
Listing permissions for user "openstack" ...
[root@controller ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...
[root@controller ~]# rabbitmqctl list_user_permissions openstack
Listing permissions for user "openstack" ...
/ .* .* .*
查看服务,正常启动
[root@compute1 ~]# systemctl status openstack-nova-compute.service
● openstack-nova-compute.service - OpenStack Nova Compute Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2017-12-07 08:04:19 CST; 18min ago
Main PID: 1069 (nova-compute)
CGroup: /system.slice/openstack-nova-compute.service
└─1069 /usr/bin/python2 /usr/bin/nova-compute
Dec 07 08:04:12 compute1.localdomain systemd[1]: Starting OpenStack Nova Compute Server...
Dec 07 08:04:19 compute1.localdomain nova-compute[1069]: Option "rpc_backend" from group "DEFAULT" is deprecate...re.
Dec 07 08:04:19 compute1.localdomain systemd[1]: Started OpenStack Nova Compute Server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@compute1 ~]#
错误信息
2017-12-06 19:29:30.155 6430 ERROR nova.compute.api [req-1e893fdc-97f1-45f1-a332-1083aeedd46a 73b048955ccf40f0b28dbd5f388b0901 a3f9b68bb68042abbe1b53131c31fe74 - 2806de7ce26d448d809b82cda6afdfac 2806de7ce26d448d809b82cda6afdfac] No cells are configured, unable to continue
没有cell
] No authentication information found for placement API. Placement is optional in Newton, but required in Ocata. Please enable the placement service before upgrading.
数据库查看
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| glance |
| information_schema |
| keystone |
| mysql |
| nova |
| nova_api |
| performance_schema |
| test |
+--------------------+
8 rows in set (0.00 sec)
MariaDB [(none)]> CREATE DATABASE nova_cell0;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| glance |
| information_schema |
| keystone |
| mysql |
| nova |
| nova_api |
| nova_cell0 |
| performance_schema |
| test |
+--------------------+
没有placement
[gsl@controller ~]$ openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | 2806de7ce26d448d809b82cda6afdfac |
| enabled | True |
| id | 6b090de2030049a885263321bb5f8ce6 |
| name | placement |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
[gsl@controller ~]$ openstack role add --project service --user placement admin
[gsl@controller ~]$ openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Placement API |
| enabled | True |
| id | cee7287d012a4c8ebfdd9dff1bd06b20 |
| name | placement |
| type | placement |
+-------------+----------------------------------+
重新验证
[gsl@controller ~]$ openstack compute service list
+----+------------------+------------------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+------------------+------------------------+----------+---------+-------+----------------------------+
| 1 | nova-consoleauth | controller.localdomain | internal | enabled | up | 2017-12-07T02:29:15.000000 |
| 2 | nova-conductor | controller.localdomain | internal | enabled | up | 2017-12-07T02:29:15.000000 |
| 4 | nova-scheduler | controller.localdomain | internal | enabled | up | 2017-12-07T02:29:10.000000 |
| 7 | nova-compute | compute1.localdomain | nova | enabled | up | 2017-12-07T02:29:10.000000 |
+----+------------------+------------------------+----------+---------+-------+----------------------------+
[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: 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:166: Warning: (1831, u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release.')
result = self._query(query)
[root@controller ~]# nova-manage cell_v2 list_cells
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
| Name | UUID | Transport URL | Database Connection |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
| cell0 | 00000000-0000-0000-0000-000000000000 | none:/ | mysql+pymysql://nova:****@controller/nova_cell0 |
| cell1 | 0e936aa4-204d-494d-8cd9-b8915ff8f5b4 | rabbit://openstack:****@controller | mysql+pymysql://nova:****@controller/nova |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
解决办法:
编辑:/etc/httpd/conf.d/openstack-dashboard.conf
在WSGISocketPrefix run/wsgi下面加一行代码:
WSGIApplicationGroup %{GLOBAL}
保存,重启httpd服务。
服务进程路径或文件
nova 服务(nova-api, nova-scheduler, nova-objectstore,nova-network,nova- compute,nova-volume)/var/log/nova(每项服务有对应的日志文件,请对应日志文件的文件名进行日志观察)
glance服务(glance-api,glance-regisry)/var/log/glance(每项服务有对应的日志文件,请对应日志文件的文件名进行日志观察)
keystone服务 /var/log/keystone/keystone.log,/var/log/syslog
rabbitmq服务 /var/log/rabbitmq
mysql服务 /var/log/mysql
libvirt服务 /var/log/libvirt
swift服务 /var/log/syslog
memcached服务 /var/log/memcached.log
正常命令 keystone user-list
debug命令为:
keystone –debug user-list
官方安装指导,变来变去,需要总结多个版本来发现问题。
修改配置一定要小心。