Giter Club home page Giter Club logo

Comments (8)

renecannao avatar renecannao commented on September 22, 2024

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.

Samuele-Z avatar Samuele-Z commented on September 22, 2024

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

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.

renecannao avatar renecannao commented on September 22, 2024

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.

Samuele-Z avatar Samuele-Z commented on September 22, 2024

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)

Log.txt

from proxysql.

JavierJF avatar JavierJF commented on September 22, 2024

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.

Samuele-Z avatar Samuele-Z commented on September 22, 2024

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.

JavierJF avatar JavierJF commented on September 22, 2024

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.

Samuele-Z avatar Samuele-Z commented on September 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.