0

I have implemented InnoDB cluster using MySql router(version - 2.1.4) for HA This is my mysqlrouter.conf file

[DEFAULT]
user=mysqlrouter
logging_folder=
runtime_folder=/tmp/mysqlrouter/run
data_folder=/tmp/mysqlrouter/data
keyring_path=/tmp/mysqlrouter/data/keyring
master_key_path=/tmp/mysqlrouter/mysqlrouter.key

    [logger]
    level = DEBUG

    [metadata_cache:magentoCluster]
    router_id=49
    bootstrap_server_addresses=mysql://ic-1:3306,mysql://ic-2:3306,mysql://ic-3:3306
    user=mysql_router49_sqxivre03wzz
    metadata_cluster=magentoCluster
    ttl=1

    [routing:magentoCluster_default_rw]
    bind_address=0.0.0.0
    bind_port=6446
    destinations=metadata-cache://magentoCluster/default?role=PRIMARY
    mode=read-write
    protocol=classic

    [routing:magentoCluster_default_ro]
    bind_address=0.0.0.0
    bind_port=6447
    destinations=metadata-cache://magentoCluster/default?role=ALL
    mode=read-only
    protocol=classic

    [routing:magentoCluster_default_x_rw]
    bind_address=0.0.0.0
    bind_port=64460
    destinations=metadata-cache://magentoCluster/default?role=PRIMARY
    mode=read-write
    protocol=x

    [routing:magentoCluster_default_x_ro]
    bind_address=0.0.0.0
    bind_port=64470
    destinations=metadata-cache://magentoCluster/default?role=ALL
    mode=read-only
    protocol=x

MySql Router split the read requests to slave nodes, if I down slave 1 then router takes some seconds to know the slave 1 is down. So the requests are sent to the down slave node and the request fails. Any Suggestion how to handle this failure?

4

1 回答 1

1

The client should always check for errors. This is a necessity for any system, because network errors, power outages, etc, can occur in any configuration.

When the client discovers a connection failure (failure to connect / dropped connection), it should start over by reconnecting and replaying the transaction it is in the middle of.

For transaction integrity, the client must be involved in the process; recovery cannot be provide by any proxy.

于 2018-03-23T18:25:42.490 回答