执行openstack network list命令时,提示如下信息:
日志文件“/var/log/neutron/server.log”提示如下信息:
oslo_messaging.rpc.server OperationalError: (pymysql.err.OperationalError) (1040, u'Too many connect
对应截图如下:
OpenStack一直处于调度中,数据库连接出现“Too many connections”,说明数据库最大连接数太小,当前已达最大连接数。
vim /etc/my.cnf.d/openstack.cnf
在[mysqld]字段下找到max_connections,设置max_connections = 4096。如下图所示:
vim /etc/security/limits.conf
* soft nofile 65536 * hard nofile 65536
添加完成后,如下图所示:
session required /lib/security/pam_limits.so
当用户完成系统登录后,Linux会调用pam_limits.so模块来限制该用户可使用的各种资源数量的最大值,包括可打开的最大文件数限制等。pam_limits.so模块会从“/etc/security/limits.conf”文件中读取配置。
ulimit -SHn 65536
vim /etc/sysctl.conf
# max open files fs.file-max = 65536
sysctl -p
LimitNOFILE=65535 LimitNPROC=65535
systemctl daemon-reload systemctl restart mariadb.service
mysql> show variables like 'max_connections';
mysql> show global status like 'Max_used_connections';
systemctl restart neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl restart openstack-glance-api.service openstack-glance-registry.service
systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service