- Miêu tả bug :
- Nguyên nhân bug
Khi cấu hình MySQL trong OpenStack, trong file /etc/my.cnf.d/openstack.cnf , cấu hình gợi ý là max_connections = 4096. Tuy nhiên, trong Centos 7 sẽ sử dụng cấu hình max_connections = 214 do systemd quy định. Vì vậy khi số kết nối của OpenStack > 214, database MySQL sẽ reject các connection.
Kiểm tra max_connections trong mysql bằng câu lệnh :
mysql -u root -p
MariaDB [(none)]> select @@max_connections;
- Fix bug
- Thêm cấu hình vào file limits.conf
echo "mysql soft nofile 4096" >> /etc/security/limits.conf
echo "mysql hard nofile 10240" >> /etc/security/limits.conf
- Tạo cấu hình trong systemd cho mariadb
mkdir -p /etc/systemd/system/mariadb.service.d
cat << EOF> /etc/systemd/system/mariadb.service.d/limits.conf
[Service]
LimitNOFILE=infinity
EOF
systemctl daemon-reload
systemctl restart mariadb
- Kiểm tra lại max_connection.
Link fix bug tham khảo : https://pjstrnad.com/mariadb-raise-number-of-connections/
systemctl start openstack-nova-api.serviceở trong mục 2.3.3, sẽ có bug như sau : http://paste.openstack.org/show/611798/Khi cấu hình MySQL trong OpenStack, trong file
/etc/my.cnf.d/openstack.cnf, cấu hình gợi ý là max_connections = 4096. Tuy nhiên, trong Centos 7 sẽ sử dụng cấu hình max_connections = 214 do systemd quy định. Vì vậy khi số kết nối của OpenStack > 214, database MySQL sẽ reject các connection.Kiểm tra max_connections trong mysql bằng câu lệnh :
Link fix bug tham khảo : https://pjstrnad.com/mariadb-raise-number-of-connections/