描述
我使用OpenStack 安装指南安装了 Openstack Wallaby ,所有命令和配置都在我的Github上。这个 LAB 在 VirtualBox 上运行,我在 ESXi 上有另一个具有相同配置和 Openstack 版本的 LAB,没有任何问题。
此时一个控制器带有两个计算节点。
在下一节中,改进正确配置的数据库权限
数据库已正确创建:
user@controller001:~$ sudo mysql
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| glance |
| information_schema |
| keystone |
| mysql |
| nova |
| nova_api |
| nova_cell0 |
| performance_schema |
| placement |
+--------------------+
授予这些数据库的所有权限:
MariaDB [(none)]> SHOW GRANTS FOR nova;
+-----------------------------------------------------------------------------------------------------+
| Grants for nova@% |
+-----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `nova`@`%` IDENTIFIED BY PASSWORD '*3A4A03AC22526F6B591010973A741D59A71D728E' |
| GRANT ALL PRIVILEGES ON `nova`.* TO `nova`@`%` |
| GRANT ALL PRIVILEGES ON `nova_cell0`.* TO `nova`@`%` |
| GRANT ALL PRIVILEGES ON `nova_api`.* TO `nova`@`%` |
+-----------------------------------------------------------------------------------------------------+
可以从计算节点远程访问数据库:
user@compute001:~$ mysql -unova -popenstack -h controller001
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| nova |
| nova_api |
| nova_cell0 |
+--------------------+
重启nova服务后的mysql日志:
user@controller001:~$ sudo systemctl restart nova-*
user@controller001:~$ sudo tail -f /var/log/mysql/error.log
2021-10-02 12:52:12 112 [Warning] Aborted connection 112 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 118 [Warning] Aborted connection 118 to db: 'nova_api' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 116 [Warning] Aborted connection 116 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 119 [Warning] Aborted connection 119 to db: 'nova_api' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 115 [Warning] Aborted connection 115 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 113 [Warning] Aborted connection 113 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 114 [Warning] Aborted connection 114 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 117 [Warning] Aborted connection 117 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 109 [Warning] Aborted connection 109 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 110 [Warning] Aborted connection 110 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 111 [Warning] Aborted connection 111 to db: 'nova' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 108 [Warning] Aborted connection 108 to db: 'nova_cell0' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 103 [Warning] Aborted connection 103 to db: 'nova_api' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 102 [Warning] Aborted connection 102 to db: 'nova_api' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:12 105 [Warning] Aborted connection 105 to db: 'nova_cell0' user: 'nova' host: 'controller001' (Got an error reading communication packets)
2021-10-02 12:52:16 141 [Warning] Access denied for user 'nova'@'controller001' (using password: YES)
2021-10-02 12:52:16 142 [Warning] Access denied for user 'nova'@'controller001' (using password: YES)
2021-10-02 12:52:17 147 [Warning] Access denied for user 'nova'@'controller001' (using password: YES)
读取通信数据包时出错
以下是解决此错误的一些建议:
SET GLOBAL max_allowed_packet = 1024 * 1024 * 256;
set @@global.max_connections = 400;
SET GLOBAL interactive_timeout=6000;
SET GLOBAL innodb_buffer_pool_size = 1024 * 1024 * 2;
任何尝试发现新主机都会导致以下错误:
user@controller001:~$ sudo su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
....
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user 'nova'@'controller001' (using password: YES)")
(Background on this error at: http://sqlalche.me/e/13/e3q8)
而且,但我不确定这是否是一个错误
user@controller001:~$ os hypervisor list
Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'sqlalchemy.exc.OperationalError'> (HTTP 500) (Request-ID: req-d6edcfa3-ccf2-4eb8-80f8-041cb55e772d)
名称配置:
user@controller001:~$ . admin-openrc
user@controller001:~$ os endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| 1e2f0fc829f84a53a337bbb70e7679af | RegionOne | nova | compute | True | internal | http://controller001:8774/v2.1 |
| 38e967a4c87f4464ba6ac965c889f6a4 | RegionOne | placement | placement | True | admin | http://controller001:8778 |
| 398d51ab439f4afc8fb7c71adc1bf3a9 | RegionOne | keystone | identity | True | internal | http://controller001:5000/v3/ |
| 4aaf9ac0ccec41978e541a0de0e55ed4 | RegionOne | nova | compute | True | public | http://controller001:8774/v2.1 |
| 52ba2047ed864b9aa6ad352ba2fe59dc | RegionOne | nova | compute | True | admin | http://controller001:8774/v2.1 |
| 659ed7ae84074b30a6a4941648b994c3 | RegionOne | placement | placement | True | internal | http://controller001:8778 |
| 9cd126c1f07e4b13946edcdc80f9f215 | RegionOne | placement | placement | True | public | http://controller001:8778 |
| aec5b18b834b4a9cad8a4efb83b1b1d7 | RegionOne | glance | image | True | internal | http://controller001:9292 |
| b1a13f51438c40b8b74ec25b89efebab | RegionOne | glance | image | True | public | http://controller001:9292 |
| c35c703090f3478aa7d960293fde1bf0 | RegionOne | keystone | identity | True | admin | http://controller001:5000/v3/ |
| ca231e48c3ad406c8ec757c765b651a6 | RegionOne | glance | image | True | admin | http://controller001:9292 |
| ff927678f6634475bd80bdba7effc3fc | RegionOne | keystone | identity | True | public | http://controller001:5000/v3/ |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
user@controller001:~$ sudo su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
+-------+--------------------------------------+---------------------------------------------+----------------------------------------------------+----------+
| Name | UUID | Transport URL | Database Connection | Disabled |
+-------+--------------------------------------+---------------------------------------------+----------------------------------------------------+----------+
| cell0 | 00000000-0000-0000-0000-000000000000 | none:/ | mysql+pymysql://nova:****@controller001/nova_cell0 | False |
| cell1 | e62ffdc8-5f28-43ef-9bcb-404812faaeae | rabbit://openstack:****@controller001:5672/ | mysql+pymysql://nova:****@controller001/nova | False |
+-------+--------------------------------------+---------------------------------------------+----------------------------------------------------+----------+
user@controller001:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 controller001
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.16.50.41 controller001
172.16.50.42 compute011
这与 MariaDB 权限或数据库 URL 无关。
使用此错误描述解决了问题,还有另一个对我不起作用的解决方案。创建与nova 安装 guied完全相同的单元格对我有用,将transport-url和database-connection添加到nova-mange命令是我的错,尽管它过去对我有用。