[MXS-1420] maxscale cannot be started again after shutdown Created: 2017-09-15  Updated: 2017-09-19  Resolved: 2017-09-19

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: 2.1.7
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Oli Sennhauser Assignee: Johan Wikman
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

linux ubuntu 14.04


Sprint: 2017-42

 Description   

when I shutdown maxscale with the shutdown command it will not start anymore afterwards.

MaxScale> shutdown maxscale
MaxScale> exit

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/mysql/product/maxscale/lib/x86_64-linux-gnu/maxscale
cd ~/product
./maxscale/bin/maxscale --config=/home/mysql/etc/maxscale.cnf --logdir=/tmp --datadir=/tmp --persistdir=/tmp --piddir=/tmp --cachedir=/tmp --log=stdout

2017-09-15 11:33:40 notice : Working directory: /tmp
2017-09-15 11:33:40 notice : MariaDB MaxScale 2.1.7 started
2017-09-15 11:33:40 notice : MaxScale is running in process 24273
2017-09-15 11:33:40 notice : Configuration file: /home/mysql/etc/maxscale.cnf
2017-09-15 11:33:40 notice : Log directory: /tmp
2017-09-15 11:33:40 notice : Data directory: /tmp
2017-09-15 11:33:40 notice : Module directory: /usr/lib/x86_64-linux-gnu/maxscale
2017-09-15 11:33:40 notice : Service cache: /tmp
2017-09-15 11:33:40 notice : Loading /home/mysql/etc/maxscale.cnf.
2017-09-15 11:33:40 notice : /home/mysql/etc/maxscale.cnf.d does not exist, not reading.
2017-09-15 11:33:40 notice : Loading generated configuration files from '/tmp'
2017-09-15 11:33:40 notice : Loading /tmp/MarGal101.cnf.
2017-09-15 11:33:40 notice : Loading /tmp/oli/maxscale-2.1.7/share/maxscale/maxscale_binlogserver_template.cnf.
2017-09-15 11:33:40 warning: Number of threads set to 6, which is greater than the number of processors available: 4
2017-09-15 11:33:40 notice : [cli] Initialise CLI router module
2017-09-15 11:33:40 notice : Loaded module cli: V1.0.0 from /usr/lib/x86_64-linux-gnu/maxscale/libcli.so
2017-09-15 11:33:40 notice : [debugcli] Initialise debug CLI router module.
2017-09-15 11:33:40 notice : Loaded module debugcli: V1.1.1 from /usr/lib/x86_64-linux-gnu/maxscale/libdebugcli.so
2017-09-15 11:33:40 notice : [binlogrouter] Initialise binlog router module.
2017-09-15 11:33:40 notice : Loaded module binlogrouter: V2.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libbinlogrouter.so
2017-09-15 11:33:40 notice : [readconnroute] Initialise readconnroute router module.
2017-09-15 11:33:40 notice : Loaded module readconnroute: V1.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libreadconnroute.so
2017-09-15 11:33:40 notice : Loaded module qlafilter: V1.1.1 from /usr/lib/x86_64-linux-gnu/maxscale/libqlafilter.so
2017-09-15 11:33:40 notice : [galeramon] Initialise the MySQL Galera Monitor module.
2017-09-15 11:33:40 notice : Loaded module galeramon: V2.0.0 from /usr/lib/x86_64-linux-gnu/maxscale/libgaleramon.so
2017-09-15 11:33:40 notice : Loaded module MySQLBackend: V2.0.0 from /usr/lib/x86_64-linux-gnu/maxscale/libMySQLBackend.so
2017-09-15 11:33:40 notice : Loaded module MySQLBackendAuth: V1.0.0 from /usr/lib/x86_64-linux-gnu/maxscale/libMySQLBackendAuth.so
2017-09-15 11:33:40 notice : Loaded module maxscaled: V2.0.0 from /usr/lib/x86_64-linux-gnu/maxscale/libmaxscaled.so
2017-09-15 11:33:40 notice : Loaded module MaxAdminAuth: V2.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libMaxAdminAuth.so
2017-09-15 11:33:40 notice : Loaded module telnetd: V1.1.1 from /usr/lib/x86_64-linux-gnu/maxscale/libtelnetd.so
2017-09-15 11:33:40 notice : Loaded module NullAuthAllow: V1.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libNullAuthAllow.so
2017-09-15 11:33:40 notice : Loaded module MySQLClient: V1.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libMySQLClient.so
2017-09-15 11:33:40 notice : Loaded module MySQLAuth: V1.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libMySQLAuth.so
2017-09-15 11:33:40 notice : No query classifier specified, using default 'qc_sqlite'.
2017-09-15 11:33:40 notice : Loaded module qc_sqlite: V1.0.0 from /usr/lib/x86_64-linux-gnu/maxscale/libqc_sqlite.so
2017-09-15 11:33:40 notice : Encrypted password file /tmp/.secrets can't be accessed (No such file or directory). Password encryption is not used.
2017-09-15 11:33:40 notice : [MySQLAuth] [MarGal101] Loaded 6 MySQL users for listener MarGal101 Listener.
2017-09-15 11:33:40 notice : Listening for connections at [::]:3306 with protocol MySQL
2017-09-15 11:33:40 notice : Listening for connections at [::]:3333 with protocol MaxScale Admin
2017-09-15 11:33:40 warning: [binlogrouter] Binlog_Service: backend database server is provided by master.ini file for use with the binlog router. Server section is no longer required.
2017-09-15 11:33:40 warning: [binlogrouter] Configuration setting 'server-id' in router_options is deprecated and will be removed in a later version of MaxScale. Please use the new setting 'server_id' instead.
2017-09-15 11:33:40 error : [binlogrouter] Service Binlog_Service, binlog directory is not specified
2017-09-15 11:33:40 error : Binlog_Service: Failed to create router instance. Service not started.
2017-09-15 11:33:40 error : Failed to start service 'Binlog_Service'.

  • Error: Failed to start all MaxScale services. Exiting.
    2017-09-15 11:33:40 notice : Listening for connections at [localhost]:4442 with protocol telnet
    2017-09-15 11:33:40 notice : Listening for connections at [/tmp/maxadmin.sock]:0 with protocol MaxScale Admin
    2017-09-15 11:33:40 error : Failed to start all MaxScale services. Exiting.

Workaround: cleanup /tmp directory but this is not really funny... I assume it will flush some binlogserver informations during shutdown which it should not...



 Comments   
Comment by Oli Sennhauser [ 2017-09-15 ]

cat maxscale.cnf
[maxscale]
threads=auto

[nodeA]
type=server
address=127.0.0.1
port=3330
protocol=MySQLBackend
monitoruser=maxscale
monitorpw=maxscale

[nodeB]
type=server
address=127.0.0.1
port=3331
protocol=MySQLBackend
monitoruser=maxscale
monitorpw=maxscale

[nodeC]
type=server
address=127.0.0.1
port=3332
protocol=MySQLBackend
monitoruser=maxscale
monitorpw=maxscale

[MySQL Monitor]
type=monitor
module=galeramon
servers=nodeA,nodeB,nodeC
user=maxscale
passwd=maxscale
monitor_interval=10000

[ProductsSelectLogger]
type=filter
module=qlafilter
filebase=/tmp/SelectProducts

[MarGal101]
type=service
router=readconnroute
router_options=synced
servers=nodeA,nodeB,nodeC
user=maxscale
passwd=maxscale
enable_root_user=1

[MaxAdmin Service]
type=service
router=cli

[MarGal101 Listener]
type=listener
service=MarGal101
protocol=MySQLClient
port=3306

[MaxAdmin Listener]
type=listener
service=MaxAdmin Service
protocol=maxscaled
port=3333

Comment by Oli Sennhauser [ 2017-09-15 ]

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/mysql/product/maxscale/lib/x86_64-linux-gnu/maxscale
cd ~/product
./maxscale/bin/maxscale --version
MaxScale 2.1.7

Comment by Massimiliano Pinto (Inactive) [ 2017-09-15 ]

oli

We see from error log:

2017-09-15 11:33:40 notice : Loaded module binlogrouter: V2.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libbinlogrouter.so
2017-09-15 11:33:40 warning: [binlogrouter] Binlog_Service: backend database server is provided by master.ini file for use with the binlog router. Server section is no longer required.
2017-09-15 11:33:40 warning: [binlogrouter] Configuration setting 'server-id' in router_options is deprecated and will be removed in a later version of MaxScale. Please use the new setting 'server_id' instead.
2017-09-15 11:33:40 error : [binlogrouter] Service Binlog_Service, binlog directory is not specified
2017-09-15 11:33:40 error : Binlog_Service: Failed to create router instance. Service not started.
2017-09-15 11:33:40 error : Failed to start service 'Binlog_Service'.

But we cannot see any Binlog Router configuration in maxscale.cnf you have provided.

Please check maxscale.cnf and remove all binlogserver configuration if not needed.

Comment by Oli Sennhauser [ 2017-09-15 ]

Did you try the test case I sent? if you cannot reproduce my test case I will investigate further

Comment by Oli Sennhauser [ 2017-09-15 ]

And did you get this comment: "Workaround: cleanup /tmp directory but this is not really funny... I assume it will flush some binlogserver informations during shutdown which it should not..."

So I have no clue where it is comming from

Comment by Massimiliano Pinto (Inactive) [ 2017-09-15 ]

Hi oli,

by looking at the maxscale log I see:

2017-09-15 11:33:40 notice : Loading /tmp/MarGal101.cnf.
2017-09-15 11:33:40 notice : Loading /tmp/oli/maxscale-2.1.7/share/maxscale/maxscale_binlogserver_template.cnf.

So maxscale is loading the template maxscale_binlogserver_template.cnf which should not be there: that file is responsible for "binlog router" messages.

I suggest to remove it from your setup and to trying: please check there are no other useless config files as well.

Massimiliano

Comment by Oli Sennhauser [ 2017-09-15 ]

OK. So we should ask the question: why is maxscale looking for this file at this strange location??? I used this location to repackage maxscale DEB into a tar-ball. Because you do not provide tar balls.
So I assume that maxscale is scanning the whole file tree below /tmp (because of datadir?) and this should really not happen...

Comment by Johan Wikman [ 2017-09-19 ]

With --persistdir you tell MaxScale the directory where configuration files created for persisting dynamic configuration changes should be placed. These files will also be read upon startup.

Thus, if you invoke MaxScale with --persistdir=/tmp it will read and process all .cnf files found under /tmp.

Generated at Thu Feb 08 04:06:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.