As max_connections no MySQL 5.7
Eu encontrei um problema, o valor de max_connction no MySQL é 214 depois de configurá-lo 1000 via edit my.cnf, assim como abaixo:
hadoop@node1:~$ mysql -V
mysql Ver 14.14 Distrib 5.7.15, for Linux (x86_64) using EditLine wrapper
Versão do MySQL: 5.7
Versão do sistema operacional: ubuntu 16.04LTS
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set (0.00 sec)
Como podemos ver, o valor variável de max_connections é 151. Em seguida, edito o arquivo de configuração do MySQL.
yang2@node1:~$ sudo vi /etc/mysql/my.cnf
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
max_connections=1000
Reinicie o serviço MySQL depois de salvar a configuração.
yang2@node1:~$ service mysql restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'mysql.service'.
Multiple identities can be used for authentication:
1. yangqiang,,, (yang2)
2. ,,, (hadoop)
Choose identity to authenticate as (1-2): 1
Password:
==== AUTHENTICATION COMPLETE ===
yang2@node1:~$
Agora, achamos que a max_connection é 1000, realmente?
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 214 |
+-----------------+-------+
1 row in set (0.00 sec)
É 214. Eu realmente não entendo esse resultado, quem pode me ajudar? valeu!