Comments - MaxScale Configuration & Usage Scenarios

7 years, 6 months ago Arto Hakola

Has this been like this always? Since when I tried this on some 1.4x build, It didn't work like this.

 
7 years, 6 months ago Markus Mäkelä

MaxScale has never changed the username of the client. The service user given in the configuration file is used for querying user information from the servers so that MaxScale can perform preliminary authentication. The monitors also have their own credentials which could explain why show processlist displays open connections created by the monitor user.

Here's example output of me connecting to a local server with the markusjm user. The server is monitored by MaxScale running on localhost with the maxuser user. I'm executing a SELECT SLEEP(1000); from another computer on the same local network and you can see that it gets "converted" to markusjm@localhost.

MariaDB [(none)]> show processlist;
+----+-------------+-----------------+-------+---------+------+--------------------+------------------+----------+
| Id | User        | Host            | db    | Command | Time | State              | Info             | Progress |
+----+-------------+-----------------+-------+---------+------+--------------------+------------------+----------+
|  1 | system user |                 | NULL  | Sleep   | 8325 | wsrep aborter idle | NULL             |    0.000 |
|  2 | system user |                 | NULL  | Sleep   | 8266 | committed 60       | NULL             |    0.000 |
| 73 | maxuser     | localhost:50726 | NULL  | Sleep   |    0 |                    | NULL             |    0.000 |
| 80 | markusjm    | localhost:50766 | dummy | Sleep   |   38 |                    | NULL             |    0.000 |
| 82 | markusjm    | localhost:50780 | NULL  | Query   |    0 | init               | show processlist |    0.000 |
+----+-------------+-----------------+-------+---------+------+--------------------+------------------+----------+
5 rows in set (0.00 sec)

Here's an excerpt from maxadmin show sessions showing the real IP of the client.

Session 9 (0x662e90)
	State:               Session ready for routing
	Service:             RW Split Router (0x64c380)
	Client DCB:          0x664400
	Client Address:      markusjm@192.168.0.200
	Connected:           Mon Sep 26 17:05:41 2016
	Idle:                159 seconds
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.