proxysql with ubuntu 16.04 and systemd

876 views
Skip to first unread message

Björn Raupach

unread,
Jun 16, 2017, 4:50:58 AM6/16/17
to proxysql
Dear group,

I am looking into proxysql but I got kind stuck right at the beginning. The test environment is Ubuntu 16.04 in VirtualBox in case that matters.

The Percona apt repository was added with guidance from https://www.percona.com/doc/percona-server/LATEST/installation/apt_repo.html

Then I did a simple apt-get install proxysql

Checked the status of the service with systemd and proxysql does not seem to start.

root@ubuntu:/home/raupach# systemctl status proxysql
● proxysql.service - LSB: High Performance Advanced Proxy for MySQL
   Loaded: loaded (/etc/init.d/proxysql; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2017-06-16 10:35:29 CEST; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 891 ExecStart=/etc/init.d/proxysql start (code=exited, status=1/FAILURE)

Jun 16 10:35:29 ubuntu systemd[1]: Starting LSB: High Performance Advanced Proxy for MySQL...
Jun 16 10:35:29 ubuntu sudo[906]:     root : TTY=unknown ; PWD=/ ; USER=proxysql ; COMMAND=/usr/bin/proxysql -c /etc/proxysql.cnf -D /var/lib/proxysql
Jun 16 10:35:29 ubuntu sudo[906]: pam_unix(sudo:session): session opened for user proxysql by (uid=0)
Jun 16 10:35:29 ubuntu proxysql[891]: Starting ProxySQL: Daemon already running on PID file 0
Jun 16 10:35:29 ubuntu sudo[906]: pam_unix(sudo:session): session closed for user proxysql
Jun 16 10:35:29 ubuntu proxysql[891]: FAILED!
Jun 16 10:35:29 ubuntu systemd[1]: proxysql.service: Control process exited, code=exited status=1
Jun 16 10:35:29 ubuntu systemd[1]: Failed to start LSB: High Performance Advanced Proxy for MySQL.
Jun 16 10:35:29 ubuntu systemd[1]: proxysql.service: Unit entered failed state.
Jun 16 10:35:29 ubuntu systemd[1]: proxysql.service: Failed with result 'exit-code'.

Here is the output from the log in /var/lib/proxysql/proxysql.log

2017-06-12 15:48:32 [INFO] ProxySQL version 1.3.6-1
2017-06-12 15:48:32 [INFO] Detected OS: Linux ubuntu 4.4.0-79-generic #100-Ubuntu SMP Wed May 17 19:58:14 UTC 2017 x86_64
2017-06-12 15:48:32 [INFO] Starting ProxySQL
2017-06-12 15:48:32 [INFO] Sucessfully started
2017-06-12 15:48:32 [INFO] Angel process started ProxySQL process 9123
2017-06-12 15:48:32 ProxySQL_Admin.cpp:2912:flush_mysql_variables___database_to_runtime(): [WARNING] Impossible to set not existing variable session_debug with value "(null)". Deleting. If the variable name is correct, this version doesn't support it
2017-06-12 15:48:32 ProxySQL_Admin.cpp:2912:flush_mysql_variables___database_to_runtime(): [WARNING] Impossible to set not existing variable ping_interval_server with value "120000". Deleting. If the variable name is correct, this version doesn't support it
Standard ProxySQL Admin rev. 0.2.0902 -- ProxySQL_Admin.cpp -- Thu May 11 02:31:33 2017
Standard MySQL Threads Handler rev. 0.2.0902 -- MySQL_Thread.cpp -- Thu May 11 02:31:33 2017
Standard MySQL Authentication rev. 0.2.0902 -- MySQL_Authentication.cpp -- Thu May 11 02:31:33 2017
2017-06-12 15:48:32 [INFO] New mysql_replication_hostgroups table
Standard Query Processor rev. 0.2.0902 -- Query_Processor.cpp -- Thu May 11 02:31:33 2017
In memory Standard Query Cache (SQC) rev. 1.2.0905 -- Query_Cache.cpp -- Thu May 11 02:31:33 2017
Standard MySQL Monitor (StdMyMon) rev. 1.2.0723 -- MySQL_Monitor.cpp -- Thu May 11 02:31:33 2017
2017-06-12 15:58:45 ProxySQL_GloVars.cpp:9:term_handler(): [WARNING] Received TERM signal: shutdown in progress...
2017-06-12 15:58:45 ProxySQL_GloVars.cpp:9:term_handler(): [WARNING] Received TERM signal: shutdown in progress...
2017-06-12 15:58:45 [INFO] Starting shutdown...

Not sure if it is related: the unit file looks different from the one in the proxysql source directory.

root@ubuntu:~# systemctl cat proxysql
# /run/systemd/generator.late/proxysql.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/proxysql
Description=LSB: High Performance Advanced Proxy for MySQL
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
Before=shutdown.target
After=local-fs.target
Conflicts=shutdown.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/proxysql start
ExecStop=/etc/init.d/proxysql stop

Thanks in advance!

kind regards,
Björn

René Cannaò

unread,
Jun 16, 2017, 5:00:57 AM6/16/17
to Björn Raupach, proxysql
Hi Björn,

most likely the issue is related to systemd .

Does proxysql starts if you try to just run   /etc/init.d/proxysql start ?

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

Björn Raupach

unread,
Jun 16, 2017, 5:07:57 AM6/16/17
to proxysql, raupach...@googlemail.com
Hi René,

thanks for the fast answer. Unfortunately init.d fails to start, too.

I disabled proxysql in systemd first and rebooted the system.

root@ubuntu:/home/raupach# /etc/init.d/proxysql start
Starting ProxySQL: Daemon already running on PID file 0
FAILED!
root@ubuntu:/home/raupach# systemctl status proxysql
● proxysql.service - LSB: High Performance Advanced Proxy for MySQL
   Loaded: loaded (/etc/init.d/proxysql; bad; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.

René Cannaò

unread,
Jun 16, 2017, 5:17:46 AM6/16/17
to Björn Raupach, proxysql
Hi,

Something doesn't seem correct here : Daemon already running on PID file 0

Is there any pid file in /var/lib/proxysql ? If yes, please delete it.

To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.

Björn Raupach

unread,
Jun 16, 2017, 5:26:15 AM6/16/17
to proxysql, raupach...@googlemail.com
Hi René,

sorry, my bad. Of course there was a proxysql.pid around.

Guess we are on track now! Thanks a lot for the fast help. Really appreciated!

/Björn

root@ubuntu:/home/raupach# /etc/init.d/proxysql start
Starting ProxySQL: Daemon already running on PID file 0
FAILED!
root@ubuntu:/home/raupach# systemctl status proxysql
● proxysql.service - LSB: High Performance Advanced Proxy for MySQL
   Loaded: loaded (/etc/init.d/proxysql; bad; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)


     root@ubuntu:/var/lib/proxysql# /etc/init.d/proxysql start
     Starting ProxySQL: DONE!
     root@ubuntu:/var/lib/proxysql# mysql -u admin -padmin -h 127.0.0.1 -P6032
     mysql: [Warning] Using a password on the command line interface can be insecure.
     Welcome to the MySQL monitor.  Commands end with ; or \g.
     Your MySQL connection id is 1
     Server version: 5.5.30 (ProxySQL Admin Module)

     Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

     Oracle is a registered trademark of Oracle Corporation and/or its
     affiliates. Other names may be trademarks of their respective
     owners.

     Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

     mysql> show databases;
     +-----+---------+-------------------------------+
     | seq | name    | file                          |
     +-----+---------+-------------------------------+
     | 0   | main    |                               |
     | 2   | disk    | /var/lib/proxysql/proxysql.db |
     | 3   | stats   |                               |
     | 4   | monitor |                               |
     +-----+---------+-------------------------------+
     4 rows in set (0.00 sec)

     mysql> 

René Cannaò

unread,
Jun 16, 2017, 5:31:53 AM6/16/17
to Björn Raupach, proxysql
Great!

Although, I wonder why the pid file was reporting that the daemon was running with PID 0 .
Maybe some race condition trying to start proxysql with and without systemd. Not sure really.

Thanks

To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages