list servers shows just Running in Status column after restart of Docker container

327 views
Skip to first unread message

warri...@gmail.com

unread,
Jan 29, 2018, 10:20:02 AM1/29/18
to MaxScale
My setup  has 
1) MariaDB  docker swarm service cluster of 3 nodes configured in multimaster mode
2) MaxScale  docker swarm service  (3 replicas) which is configured to monitor and direct writes to MariaDB cluster nodes.
3) Docker Swarm service  Java Client  connecting to Maxscale service published port 4306 which sends R/W queries 


Below is the configuration Maxscale configuration:

# MaxScale documentation on GitHub:
https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Documentation-Contents.md


# Global parameters
#
# Complete list of configuration options:
https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Getting-Started/Configuration-Guide.md


[maxscale]
threads
=1


# Server definitions
#
# Set the address of the server to the network
# address of a MySQL server.
#


[master]
type
=server
address
=10.0.0.208
port
=3306
protocol
=MySQLBackend


[master2]
type
=server
address
=10.0.0.221
port
=3306
protocol
=MySQLBackend


[master3]
type
=server
address
=10.0.0.209
port
=3306
protocol
=MySQLBackend




# Monitor for the servers
#
# This will keep MaxScale aware of the state of the servers.
# MySQL Monitor documentation:
https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Monitors/MySQL-Monitor.md


[MySQL Monitor]
type
=monitor
module=galeramon
servers
=master,master2,master3
user
=root
passwd
=test
monitor_interval
=10000


# Service definitions
#
# Service Definition for a read-only service and
# a read/write splitting service.
#


# ReadConnRoute documentation:
https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadConnRoute.md


# ReadWriteSplit documentation:
https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadWriteSplit.md


[RW-Service]
type
=service
router
=readwritesplit
servers
=master,master2,master3
user
=root
passwd
=test
max_slave_connections
=100%


# This service enables the use of the MaxAdmin interface
# MaxScale administration guide:
https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Reference/MaxAdmin.md




# Listener definitions for the services
#
# These listeners represent the ports the
# services will listen on.
#
[Write-Listener]
type
=listener
service
=RW-Service
port
=4306
protocol
=MySQLClient
#socket=/tmp/rwsplit.sock 




[MaxAdmin]
type
=service
router
=cli


[MaxAdmin Unix Listener]
type
=listener
service
=MaxAdmin
protocol
=maxscaled
socket
=default


[MaxAdmin Inet Listener]
type
=listener
service
=MaxAdmin
protocol
=maxscaled
address
=localhost
port
=6603

Below is the output of maxadmin before the restart:

-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status
-------------------+-----------------+-------+-------------+--------------------
master             | 10.0.0.208      |  3306 |           0 | Slave, Synced, Running
master2            | 10.0.0.221      |  3306 |           0 | Master, Synced, Running
master3            | 10.0.0.209      |  3306 |           0 | Slave, Synced, Running

after the VM restart  where master3 ran I changed the address=10.0.0.209 to address=10.0.0.221 and ran reload config below is the output :

[root@e59817ccaed8 /]# maxadmin
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status
-------------------+-----------------+-------+-------------+--------------------
master3            | 10.0.0.161      |  3306 |           0 | Running
master             | 10.0.0.208      |  3306 |           0 | Slave, Synced, Running
master2            | 10.0.0.221      |  3306 |           0 | Master, Synced, Running
master3            | 10.0.0.209      |  3306 |           0 | Down
-------------------+-----------------+-------+-------------+--------------------

What is meant by Running? Is it ok or it should be Slave, Synced, Running?
I checked that the node rejoined the maria cluster and cluster size is 3. Tried restarting montior. Nothing helped.

Thanks in advance.
Regards.

Markus Mäkelä

unread,
Jan 29, 2018, 10:52:07 AM1/29/18
to maxs...@googlegroups.com

Hi,

The reload config command is deprecated and never worked correctly. We recommend using the runtime configuration commands added to MaxAdmin in MaxScale 2.1. For more information, you can read this document: https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale-21-maxadmin-admin-interface/#runtime-configuration-changes

Markus

--
You received this message because you are subscribed to the Google Groups "MaxScale" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxscale+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Markus Mäkelä, Software Engineer
MariaDB Corporation
t: +358 40 7740484 | Skype: markus.j.makela 

warri...@gmail.com

unread,
Jan 30, 2018, 7:16:27 AM1/30/18
to MaxScale
Hi, Markus.
Thanks a lot.
Though, i didn't succeed the irrelevant server from monitor and services even MaxAdmin confirms the server has been removed from monitor/service.
 Am i doing smth. wrong?
Moreover when master3 is removed which one is removed - the new or the old? 
This was run after i tried to reload config, so maybe it's related. Will try again without it.
Below is the commands sequence:

[root@e59817ccaed8 /]# maxadmin
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status
-------------------+-----------------+-------+-------------+--------------------
master3            | 10.0.0.161      |  3306 |           0 | Running
master             | 10.0.0.208      |  3306 |           0 | Slave, Synced, Running
master2            | 10.0.0.221      |  3306 |           0 | Master, Synced, Running
master3            | 10.0.0.209      |  3306 |           0 | Down
-------------------+-----------------+-------+-------------+--------------------
MaxScale> list services
Services.
--------------------------+-------------------+--------+----------------+-------------------
Service Name              | Router Module     | #Users | Total Sessions | Backend databases
--------------------------+-------------------+--------+----------------+-------------------
RW-Service                | readwritesplit    |      1 |              1 | master, master2, master3
MaxAdmin                  | cli               |      5 |              5 |
--------------------------+-------------------+--------+----------------+-------------------

MaxScale> remove server master3
Incorrect number of arguments: remove server expects at least 2 arguments
MaxScale> remove server master3 RW-Service
Removed server 'master3' from 'RW-Service'
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status
-------------------+-----------------+-------+-------------+--------------------
master3            | 10.0.0.161      |  3306 |           0 | Running
master             | 10.0.0.208      |  3306 |           0 | Slave, Synced, Running
master2            | 10.0.0.221      |  3306 |           0 | Master, Synced, Running
master3            | 10.0.0.209      |  3306 |           0 | Down
-------------------+-----------------+-------+-------------+--------------------
MaxScale> list services
Services.
--------------------------+-------------------+--------+----------------+-------------------
Service Name              | Router Module     | #Users | Total Sessions | Backend databases
--------------------------+-------------------+--------+----------------+-------------------
RW-Service                | readwritesplit    |      1 |              1 | master, master2, master3
MaxAdmin                  | cli               |      5 |              5 |
--------------------------+-------------------+--------+----------------+-------------------

MaxScale> remove server master3
Incorrect number of arguments: remove server expects at least 2 arguments
MaxScale> remove server master3 RW-Service
Removed server 'master3' from 'RW-Service'
MaxScale> list services
Services.
--------------------------+-------------------+--------+----------------+-------------------
Service Name              | Router Module     | #Users | Total Sessions | Backend databases
--------------------------+-------------------+--------+----------------+-------------------
RW-Service                | readwritesplit    |      1 |              1 | master, master2, master3
MaxAdmin                  | cli               |      5 |              5 |
--------------------------+-------------------+--------+----------------+-------------------

MaxScale> list monitors
---------------------+---------------------
Monitor              | Status
---------------------+---------------------
MySQL-Monitor        | Running
---------------------+---------------------
MaxScale> remove server master3 MySQL-Monitor
Removed server 'master3' from 'MySQL-Monitor'
MaxScale> list monitors
---------------------+---------------------
Monitor              | Status
---------------------+---------------------
MySQL-Monitor        | Running
---------------------+---------------------
MaxScale> list services
Services.
--------------------------+-------------------+--------+----------------+-------------------
Service Name              | Router Module     | #Users | Total Sessions | Backend databases
--------------------------+-------------------+--------+----------------+-------------------
RW-Service                | readwritesplit    |      1 |              1 | master, master2, master3
MaxAdmin                  | cli               |      5 |              5 |
--------------------------+-------------------+--------+----------------+-------------------

MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status
-------------------+-----------------+-------+-------------+--------------------
master3            | 10.0.0.161      |  3306 |           0 | Running
master             | 10.0.0.208      |  3306 |           0 | Slave, Synced, Running
master2            | 10.0.0.221      |  3306 |           0 | Master, Synced, Running
master3            | 10.0.0.209      |  3306 |           0 | Down
-------------------+-----------------+-------+-------------+--------------------

Thanks in advance.

warri...@gmail.com

unread,
Jan 30, 2018, 7:29:21 AM1/30/18
to MaxScale
Have tried: 

alter server master address=new_virt_ip

and it worked!
Thanks a lot.


On Monday, January 29, 2018 at 5:52:07 PM UTC+2, Markus Mäkelä wrote:

Markus Mäkelä

unread,
Jan 30, 2018, 8:02:10 AM1/30/18
to maxs...@googlegroups.com

Hi,

I think that behavior is caused by the reload config and restarting MaxScale should fix it.

Markus

warri...@gmail.com

unread,
Jan 30, 2018, 8:34:33 AM1/30/18
to MaxScale
Maybe, 
I succeeded to alter server ip in runtime after restarting MaxScale service.
As a followup question: 
Documentation states that runtime configuration is persisted :

Any runtime configuration changes to servers are persisted meaning that they will still be in effect even after a restart

So no need to modify and keep in sync maxscale.cnf for each MaxScale instance as described here in case of VM/Maria Container restarts and thus virtual ip changes?
Thanks in advance.
Regards.

Markus Mäkelä

unread,
Jan 30, 2018, 9:26:21 AM1/30/18
to maxs...@googlegroups.com

Hi,

The configurations made at runtime are saved into a file (you can find these in /var/lib/maxscale/maxscale.cnf.d/) which makes the changes persistent. The original configuration file is not modified since MaxScale rarely has write access to its own configuration file.

Starting with MaxScale 2.1, you can sync configuration files by using rsync on the persisted configuration file directory /var/lib/maxscale/maxscale.cnf.d/ and then copy the original configuration file. This should allow you to duplicate a running MaxScale setup on another server.

Markus

Reply all
Reply to author
Forward
0 new messages