问题描述:
openstack 控制台 novnc报错,Failed to connect to server
原因为:
mysql 最大连接数太小,连接不了
解决过程:
进入controller节点查看nova日志
# tail -f -n100 /var/log/nova/nova-novncproxy.log 2020-08-28 12:45:11.751 434322 INFO nova.console.websocketproxy [req-9caa0c61-7e85-4d3b-98a5-539ac884cb21 - - - - -] handler exception: (pymysql.err.OperationalError) (1040, u'Too many connections') (Background on this error at: http://sqlalche.me/e/e3q8)
从日志可以看出是mysql连接数的问题,于是到数据库里查看:
看当前连接数,发现最大连接数太小
MariaDB [(none)]> show variables like '%max_connections%'; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | extra_max_connections | 1 | | max_connections | 594 | +-----------------------+-------+ 2 rows in set (0.001 sec) 查看当前最大连接数 MariaDB [(none)]> show variables like ‘%max_connections%’; 将最大连接数改多点: MariaDB [(none)]> set GLOBAL max_connections=1000; Query OK, 0 rows affected (0.000 sec) MariaDB [(none)]> show variables like '%max_connections%'; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | extra_max_connections | 1 | | max_connections | 1000 | +-----------------------+-------+ 2 rows in set (0.001 sec)
可以