In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what to do with MySQL 'Too many connections' in OpenStack environment". In daily operation, I believe many people have doubts about what to do with MySQL' Too many connections' in OpenStack environment. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "what to do with MySQL 'Too many connections' in OpenStack environment"! Next, please follow the editor to study!
We have built the openstack environment in the virtual machine environment several times before, except that everything is normal except that the network node can connect with the instance because of the network policy, so we applied for the switch and three physical machines to build the Openstack to avoid the impact of existing network policies.
After the completion of the sub-component construction, a large number of exception prompts appeared in dashboard at the step of creating an instance. After checking the nova log, it was found that mysql reported 'Too many connections''.
2017-02-22 11 94f2 30 INFO nova.osapi_compute.wsgi.server 10.764 24509 INFO nova.osapi_compute.wsgi.server [req-7d5b04d4-8b4a-4953-94f2-4b3d284e5301 c2dda1f21faa49ef9ff589b98f6b5fd3 166a0459c60f4953b5597974b5b2e3d7-5fafae76caaa43aaa2290f24ad147411 5fafae76caaa43aaa2290f24ad147411] 10.60.30.53 "GET / v2.1/166a0459c60f4953b5597974b5b2e3d7/os-services HTTP/1.1" status: 200 len: 1174 time: 0.0233388ine 385, in connect2017-02-21 19 Vera 25 Vera 17.245 24542 ERROR nova.api.openstack.extensions return self.dbapi.connect (* cargs * * cparams) 2017-02-21 19 line 25 cparams 17.245 24542 ERROR nova.api.openstack.extensions File "/ usr/lib/python2.7/site-packages/pymysql/__init__.py", line 90, in Connect2017-02-21 1915 14 14 ERROR nova.api.openstack.extensions return Connection (* args) * * kwargs) 2017-02-21 19line 25 kwargs 17.245 24542 ERROR nova.api.openstack.extensions File "/ usr/lib/python2.7/site-packages/pymysql/connections.py", line 694, in _ _ 245-02-21 19V 25 kwargs 17.245 24542 ERROR nova.api.openstack.extensions self.connect () 2017-02-21 19 Swiss 25 kwargs 17.245 24542 ERROR nova.api.openstack.extensions File "/ usr/lib/python2.7/site-packages/pymysql/connections.py" Line 916, in connect2017-02-21 19V 25 ERROR nova.api.openstack.extensions self._request_authentication 17.245 24542 ERROR nova.api.openstack.extensions self._request_authentication () 2017-02-21 19V 25V 17.245 24542 ERROR nova.api.openstack.extensions File "/ usr/lib/python2.7/site-packages/pymysql/connections.py", line 1124 In _ request_authentication2017-02-21 19 ERROR nova.api.openstack.extensions auth_packet 25 ERROR nova.api.openstack.extensions auth_packet 17.245 24542 ERROR nova.api.openstack.extensions auth_packet = self._read_packet () 2017-02-21 19 ERROR nova.api.openstack.extensions auth_packet 25 ERROR nova.api.openstack.extensions auth_packet 17.245 24542 ERROR nova.api.openstack.extensions File "/ usr/lib/python2.7/site-packages/pymysql/connections.py", line In _ read_packet2017-02-21 19 ERROR nova.api.openstack.extensions packet.check_error 25 ERROR nova.api.openstack.extensions File 17.245 24542 ERROR nova.api.openstack.extensions packet.check_error () 2017-02-21 19 ERROR nova.api.openstack.extensions packet.check_error 17.245 24542 ERROR nova.api.openstack.extensions File "/ usr/lib/python2.7/site-packages/pymysql/connections.py" In check_error2017-02-21 19 self._data 25 ERROR nova.api.openstack.extensions File 17.245 24542 ERROR nova.api.openstack.extensions err.raise_mysql_exception (self._data) 2017-02-21 19V 25 self._data 17.245 24542 ERROR nova.api.openstack.extensions File "/ usr/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception2017-02-21 19 self._data 25 self._data 17.245 24542 ERROR nova.api.openstack.extensions raise errorclass (errno) Errval) 2017-02-21 19 pymysql.err.OperationalError 25 pymysql.err.OperationalError 17.245 24542 ERROR nova.api.openstack.extensions OperationalError: (pymysql.err.OperationalError) (1040, u'Too many connections') 2017-02-21 1919 14 ERROR nova.api.openstack.extensions
Looking at the current connections in mysql, we found that there were a large number of connections from controller nodes. Because we were eager to deploy OK for the entire environment, we increased the number of connections to mysql and restarted it.
The dashboard is normal after reboot, and the instance creation is normal. However, if you look at the connections of mysql, you can find that there are currently more than 1000 connections, which is too abnormal.
After a series of analysis, it is found that there are 98 nova-api processes in controller nodes and 151related processes in neutron process 53.
By looking at it, it is found that there are many processes in almost all components, which explains why the number of mysql connections is so high.
By looking at nova.conf, it is found that the nova process is related to the number of cpu cores. It used to be running on a 4-core virtual machine, but now it is running on a 48-core physical machine, so this problem arises.
[DEFAULT] # Number of workers for metadata service. The default will be the number of CPUs# available. (integer value) # metadata_workers=# Number of workers for OpenStack API service. The default will be the number of# CPUs available. (integer value) # osapi_compute_workers= [places] # # Number of workers for OpenStack Conductor service. The default will be the# number of CPUs available.# (integer value) # workers=
If the show variables like "max_connections"; remains unchanged, you need to modify the restrictions on centos7:
Solution: modify the configuration of the mariadb service and restart the service configuration after adding the following two lines.
[root@controller ~] # less / usr/lib/systemd/system/ Mariadb.service] Type=simpleUser=mysqlGroup=mysqlLimitNOFILE=65535 (added under the service tag) LimitNPROC=65535 (added under the service tag), the study on "what to do with MySQL 'Too many connections' in the OpenStack environment" is over. I hope to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.