Comments (8)
Hi @Samuele-Z .
This is expected behavior.
ProxySQL will not bring the server ONLINE
if it has no reason to use that server.
In other words, if you use proxysql, it will bring the server back ONLINE
; if you don't use proxyql, the server will stay SHUNNED
from proxysql.
Hi @Samuele-Z .
This is expected behavior. ProxySQL will not bring the server
ONLINE
if it has no reason to use that server. In other words, if you use proxysql, it will bring the server backONLINE
; if you don't use proxyql, the server will staySHUNNED
Wait a moment.
I have a client application doing query on database server throught proxysql. These query return error until i connect to ProxySQL admin console and execute the select on runtime_mysql_servers. If i do some one else query happens nothing. Only querying specific table runtime_mysql_servers trigger update status.
from proxysql.
Can you please provide a reproducible test case?
What you describe shouldn't happen.
A client using proxysql will bring status back to ONLINE.
And as usual: full error log is very important . Thanks
from proxysql.
I have a galera cluster of 3 nodes. On each node I installed proxysql in cluster configuration. I followed tutorials on my first post. I want only one node active at a time doing all writes and all reads. No need to split query.
I attach here full log (i omit only some repated check from load balancer). Start reading at 12:21 (lines before are if you need it)
from proxysql.
Hi @Samuele-Z ,
Could you please share the following configuration?
SELECT * FROM global_variables WHERE variable_name LIKE '%monitor_%' AND variable_name NOT IN ('mysql-monitor_username', 'mysql-monitor_password');
SELECT * FROM mysql_servers;
SELECT * FROM mysql_galera_hostgroups;
This should give us further info for the investigation.
Thanks, Javier.
from proxysql.
Hi @Samuele-Z ,
Could you please share the following configuration?
Hi, here the results:
SELECT * FROM global_variables WHERE variable_name LIKE '%monitor_%' AND variable_name NOT IN ('mysql-monitor_username', 'mysql-monitor_password');
+----------------------------------------------------------------------+----------------+
| variable_name | variable_value |
+----------------------------------------------------------------------+----------------+
| mysql-monitor_enabled | true |
| mysql-monitor_connect_timeout | 600 |
| mysql-monitor_ping_max_failures | 3 |
| mysql-monitor_ping_timeout | 1000 |
| mysql-monitor_read_only_max_timeout_count | 3 |
| mysql-monitor_replication_lag_group_by_host | false |
| mysql-monitor_replication_lag_interval | 10000 |
| mysql-monitor_replication_lag_timeout | 1000 |
| mysql-monitor_replication_lag_count | 1 |
| mysql-monitor_groupreplication_healthcheck_interval | 5000 |
| mysql-monitor_groupreplication_healthcheck_timeout | 800 |
| mysql-monitor_groupreplication_healthcheck_max_timeout_count | 3 |
| mysql-monitor_groupreplication_max_transactions_behind_count | 3 |
| mysql-monitor_groupreplication_max_transactions_behind_for_read_only | 1 |
| mysql-monitor_galera_healthcheck_interval | 5000 |
| mysql-monitor_galera_healthcheck_timeout | 800 |
| mysql-monitor_galera_healthcheck_max_timeout_count | 3 |
| mysql-monitor_replication_lag_use_percona_heartbeat | |
| mysql-monitor_query_interval | 60000 |
| mysql-monitor_query_timeout | 100 |
| mysql-monitor_slave_lag_when_null | 60 |
| mysql-monitor_threads_min | 8 |
| mysql-monitor_threads_max | 128 |
| mysql-monitor_threads_queue_maxsize | 128 |
| mysql-monitor_local_dns_cache_ttl | 300000 |
| mysql-monitor_local_dns_cache_refresh_interval | 60000 |
| mysql-monitor_local_dns_resolver_queue_maxsize | 128 |
| mysql-monitor_wait_timeout | true |
| mysql-monitor_writer_is_also_reader | true |
| mysql-monitor_history | 600000 |
| mysql-monitor_connect_interval | 2000 |
| mysql-monitor_ping_interval | 2000 |
| mysql-monitor_read_only_interval | 2000 |
| mysql-monitor_read_only_timeout | 500 |
+----------------------------------------------------------------------+----------------+
34 rows in set (0.002 sec)
Admin> SELECT * FROM mysql_servers;
+--------------+---------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+---------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 0 | 10.200.20.104 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 0 | 10.200.20.105 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 0 | 10.200.20.106 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 1 | 10.200.20.104 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 1 | 10.200.20.105 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 1 | 10.200.20.106 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 2 | 10.200.20.104 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 2 | 10.200.20.105 | 3307 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
+--------------+---------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
8 rows in set (0.001 sec)
Admin> SELECT * FROM mysql_galera_hostgroups;
+------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+---------+
| writer_hostgroup | backup_writer_hostgroup | reader_hostgroup | offline_hostgroup | active | max_writers | writer_is_also_reader | max_transactions_behind | comment |
+------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+---------+
| 0 | 2 | 1 | 4 | 1 | 1 | 1 | 100 | NULL |
+------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+---------+
1 row in set (0.001 sec)
Thanks.
from proxysql.
Hi @Samuele-Z,
this is an issue with your configuration, let me elaborate. ProxySQL only perform monitoring actions on servers that are responsive to ping, once a server is not responsive, no further monitoring actions take place on the server:
2024-05-08 12:35:15 MySQL_Monitor.cpp:2890:monitor_ping(): [ERROR] Server 10.200.20.196:3307 missed 3 heartbeats, shunning it and killing all the connections. Disabling other checks until the node comes back online.
This is determined by your monitoring ping configuration:
SET mysql-monitor_ping_max_failures=3;
SET mysql-monitor_ping_timeout=1000;
SET mysql-monitor_ping_interval=2000;
The monitoring of the cluster, is controlled by the following configuration variables:
SET mysql-monitor_galera_healthcheck_interval=5000;
SET mysql-monitor_galera_healthcheck_timeout=800;
SET mysql-monitor_galera_healthcheck_max_timeout_count=3;
Seeing the variables side by side, and with the previous context, the problem is more obvious. Your ping interval is too low compared with your galera_healthcheck
. This means that before Monitor
is going to perform any action on that server, the monitoring itself is going to be disabled for it. You may experience that sometimes the server does indeed get moved as ONLINE
, that's because the Galera monitoring check will match exactly with the server shutdown, and another error than a timeout will be detected. For fixing the issue, you just need to ensure that galera_healthcheck_interval * galera_healtcheck_max_timeout_count
is smaller than the server ping_max_failures * ping_interval
. This way you will ensure that a monitoring action is performed on the server before monitoring gets disabled for it.
SELECT * FROM runtime_mysql_servers
I wanted to clarify also the effect that you see when you select on runtime_mysql_servers
. This is just a side effect of the table rebuild. The table runtime_mysql_servers
isn't a table that is constantly rebuild, it's build on demand, whenever is required due to monitoring actions or due to user interaction. Temporary server status like SHUNNED
are not propagated to this table, until it's rebuilded by one of the previous actions, this is also expected behavior. The Galera
implementation from the monitoring module, makes use of this table for performing the server placement, and due to your previous configuration, the table isn't change at all because no monitoring actions are performed. So, Monitor
isn't aware of the server status until the query rebuilds the table, the very next monitoring action detects the missing (SHUNNED
) server and replaces the writer.
This interaction is likely to change in the future like it changed already for other cluster monitoring solutions.
Hope this helps to clarify the issue. Thanks, Javier.
from proxysql.
Hi @JavierJF thanks for your reply. I changed value of mysql-monitor_galera_healthcheck_interval
to 1500 and now it works.
from proxysql.
Related Issues (20)
- Question : when a node from reader hostgroup and lost his READ_ONLY HOT 3
- Implement setting in `mysql_hostgroup_attributes` to override global `mysql-monitor_slave_lag_when_null`
- proxySQL can not properly distribute slow queries after linux update HOT 2
- Unable to parse query. If correct, report it as a bug: SET SESSION wsrep_sync_wait=? HOT 2
- [Question] Does ProxySQL Provide Metrics for User Maximum Connections and Current Connection Usage? HOT 2
- Evaluate exporting `stats_mysql_users` using the Prometheus exporter HOT 3
- Every uneven traffic distribution for nodes with same weight after upgrading from v2.0.10-1 to v2.5.5-1 HOT 1
- Ever increasing 'stats_mysql_query_digest' results in sporadic client timings HOT 5
- Official documentation has missing introduced version information for mysql-connection_warming
- Implement setting in `mysql_hostgroup_attributes` to define custom load balancing algorithm
- ProxySQL errorlog not getting picked up from proxysql.cnf in docker HOT 5
- crashes during cluster shutdown in CI testing HOT 1
- Support some form of partial cleanup of `stats_mysql_query_digest`
- Intermittent "Access denied" errors HOT 1
- Different server_version per port
- Wrong column order in table mysql_servers HOT 3
- aarch64 / i686 builds fail of v2.6.2 (narrowing conversion of timeout in clickhouse) HOT 2
- Can not set servers_defaults field of mysql_hostgroup_attributes table from config file HOT 5
- Clients seeing "Lost connection to MySQL server during query" errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxysql.