sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
5.95k stars 970 forks source link

Proxysql-initial unable to start service #4661

Closed kaushikpuneet07 closed 3 hours ago

kaushikpuneet07 commented 3 hours ago

Hi ,

OS : Ubuntu Noble Nubat Proxysql version : 2.6.5

mysql> INSERT INTO mysql_servers(hostgroup_id,hostname,port) VALUES (1,'127.0.0.2',3306);
Query OK, 1 row affected (0.00 sec)

mysql> load mysql servers to runtime;
Query OK, 0 rows affected (0.01 sec)

mysql> save mysql servers to disk;
Query OK, 0 rows affected (0.20 sec)

mysql> select * from mysql_servers;
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname  | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 1            | 127.0.0.2 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
1 row in set (0.00 sec)

vagrant@noble:/usr/lib/systemd/system$ sudo service proxysql stop

vagrant@noble:/usr/lib/systemd/system$ sudo service proxysql-initial start

○ proxysql.service - High Performance Advanced Proxy for MySQL
     Loaded: loaded (/usr/lib/systemd/system/proxysql.service; enabled; preset: enabled)
     Active: inactive (dead) since Fri 2024-09-20 07:29:41 UTC; 4min 48s ago
   Duration: 54.728s
    Process: 22181 ExecStart=/usr/bin/proxysql --idle-threads -c /etc/proxysql.cnf $PROXYSQL_OPTS (code=exited, status=0/SUCCESS)
   Main PID: 22183 (code=exited, status=0/SUCCESS)
        CPU: 2.879s

Sep 20 07:28:46 noble proxysql[22181]: 2024-09-20 07:28:46 [INFO] Using jemalloc with MALLOC_CONF: config.xmalloc:1, lg_tcache_max:1>
Sep 20 07:28:46 noble proxysql[22181]: 2024-09-20 07:28:46 [INFO] Using config file /etc/proxysql.cnf
Sep 20 07:28:46 noble proxysql[22181]: 2024-09-20 07:28:46 [INFO] Current RLIMIT_NOFILE: 102400
Sep 20 07:28:46 noble proxysql[22181]: 2024-09-20 07:28:46 [INFO] Using OpenSSL version: OpenSSL 3.3.1 4 Jun 2024
Sep 20 07:28:46 noble proxysql[22181]: 2024-09-20 07:28:46 [INFO] SSL keys/certificates found in datadir (/var/lib/proxysql): loadin>
Sep 20 07:28:46 noble systemd[1]: Started proxysql.service - High Performance Advanced Proxy for MySQL.
Sep 20 07:29:41 noble systemd[1]: Stopping proxysql.service - High Performance Advanced Proxy for MySQL...
Sep 20 07:29:41 noble systemd[1]: proxysql.service: Deactivated successfully.
Sep 20 07:29:41 noble systemd[1]: Stopped proxysql.service - High Performance Advanced Proxy for MySQL.
Sep 20 07:29:41 noble systemd[1]: proxysql.service: Consumed 2.879s CPU time.

Error log

2024-09-20 07:28:46 [INFO] ProxySQL version 2.6.5-7-gbd7bd35
2024-09-20 07:28:46 [INFO] Detected OS: Linux noble 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
2024-09-20 07:28:46 [INFO] ProxySQL SHA1 checksum: f295ed7fb2f3c21cb658ea752da51b3319d62af0
2024-09-20 07:28:46 [INFO] Starting ProxySQL
2024-09-20 07:28:46 [INFO] Successfully started
2024-09-20 07:28:46 [INFO] Angel process started ProxySQL process 22184
2024-09-20 07:28:46 [INFO] SSL keys/certificates found in datadir (/var/lib/proxysql): loading them.
2024-09-20 07:28:46 [INFO] Loaded built-in SQLite3
Standard ProxySQL MySQL Logger rev. 2.5.0421 -- MySQL_Logger.cpp -- Thu Aug 29 12:34:38 2024
Standard ProxySQL Cluster rev. 0.4.0906 -- ProxySQL_Cluster.cpp -- Thu Aug 29 12:34:38 2024
Standard ProxySQL Statistics rev. 1.4.1027 -- ProxySQL_Statistics.cpp -- Thu Aug 29 12:34:38 2024
2024-09-20 07:28:46 [INFO] Using UUID from database: 642b2521-165d-4a03-99c6-154d07eb68e2
2024-09-20 07:28:46 [INFO] Computed checksum for 'LOAD ADMIN VARIABLES TO RUNTIME' was '0xDAED25CA5E7F3411', with epoch '1726817326'
2024-09-20 07:28:46 [INFO] Computed checksum for 'LOAD MYSQL VARIABLES TO RUNTIME' was '0xC74607BEB41AD62A', with epoch '1726817326'
Standard ProxySQL Admin rev. 2.0.6.0805 -- ProxySQL_Admin.cpp -- Thu Aug 29 12:34:38 2024
2024-09-20 07:28:46 [INFO] ProxySQL SHA1 checksum: f295ed7fb2f3c21cb658ea752da51b3319d62af0
Standard MySQL Threads Handler rev. 0.2.0902 -- MySQL_Thread.cpp -- Thu Aug 29 12:34:38 2024
Standard MySQL Authentication rev. 0.2.0902 -- MySQL_Authentication.cpp -- Thu Aug 29 12:34:38 2024
2024-09-20 07:28:46 [INFO] Computed checksum for 'LOAD MYSQL USERS TO RUNTIME' was '0x0000000000000000', with epoch '1726817326'
2024-09-20 07:28:47 [INFO] Generating runtime mysql servers and mysql servers v2 records.
2024-09-20 07:28:47 [INFO] Dumping mysql_servers_incoming
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2024-09-20 07:28:47 [INFO] Dumping mysql_servers LEFT JOIN mysql_servers_incoming
+-------------+--------------+----------+------+
| mem_pointer | hostgroup_id | hostname | port |
+-------------+--------------+----------+------+
+-------------+--------------+----------+------+
2024-09-20 07:28:47 [INFO] Dumping mysql_servers JOIN mysql_servers_incoming
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment | mem_pointer | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
+--------------+----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2024-09-20 07:28:47 [INFO] New mysql_group_replication_hostgroups table
2024-09-20 07:28:47 [INFO] New mysql_galera_hostgroups table
2024-09-20 07:28:47 [INFO] New mysql_aws_aurora_hostgroups table
2024-09-20 07:28:47 [INFO] New mysql_hostgroup_attributes table
2024-09-20 07:28:47 [INFO] New mysql_servers_ssl_params table
2024-09-20 07:28:47 [INFO] Checksum for table mysql_servers_v2 is 0x0000000000000000
2024-09-20 07:28:47 [INFO] New computed global checksum for 'mysql_servers_v2' is '0x0000000000000000'
2024-09-20 07:28:47 [INFO] Checksum for table mysql_servers is 0x0000000000000000
2024-09-20 07:28:47 [INFO] MySQL_HostGroups_Manager::commit() locked for 2ms
2024-09-20 07:28:47 [INFO] Computed checksum for 'LOAD PROXYSQL SERVERS TO RUNTIME' was '0x0000000000000000', with epoch '1726817327'
Standard Query Processor rev. 2.0.6.0805 -- Query_Processor.cpp -- Thu Aug 29 12:34:38 2024
2024-09-20 07:28:47 [INFO] Computed checksum for 'LOAD MYSQL QUERY RULES TO RUNTIME' was '0x0000000000000000', with epoch '1726817327'
In memory Standard Query Cache (SQC) rev. 1.2.0905 -- Query_Cache.cpp -- Thu Aug 29 12:34:38 2024
Standard MySQL Monitor (StdMyMon) rev. 2.0.1226 -- MySQL_Monitor.cpp -- Thu Aug 29 12:34:38 2024
Standard ProxySQL HTTP Server Handler rev. 1.4.1031 -- ProxySQL_HTTP_Server.cpp -- Thu Aug 29 12:34:38 2024
2024-09-20 07:28:47 [INFO] For information about products and services visit: https://proxysql.com/
2024-09-20 07:28:47 [INFO] For online documentation visit: https://proxysql.com/documentation/
2024-09-20 07:28:47 [INFO] For support visit: https://proxysql.com/services/support/
2024-09-20 07:28:47 [INFO] For consultancy visit: https://proxysql.com/services/consulting/
2024-09-20 07:28:47 [INFO] Latest ProxySQL version available: 2.7.0-11-g3835029
2024-09-20 07:29:14 [INFO] Received load mysql servers to runtime command
2024-09-20 07:29:14 [INFO] Generating runtime mysql servers and mysql servers v2 records.
2024-09-20 07:29:14 [INFO] Dumping current MySQL Servers structures for hostgroup ALL
2024-09-20 07:29:14 [INFO] Dumping mysql_servers: ALL
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
| hid | hostname | port | gtid | weight | status | cmp | max_conns | max_lag | ssl | max_lat | comment | mem_pointer |
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
2024-09-20 07:29:14 [INFO] Dumping mysql_servers_incoming
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname  | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 1            | 127.0.0.2 | 3306 | 0         | 1      | 0      | 0           | 1000            | 0                   | 0       | 0              |         |
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2024-09-20 07:29:14 [INFO] Dumping mysql_servers LEFT JOIN mysql_servers_incoming
+-------------+--------------+----------+------+
| mem_pointer | hostgroup_id | hostname | port |
+-------------+--------------+----------+------+
+-------------+--------------+----------+------+
2024-09-20 07:29:14 [INFO] Dumping mysql_servers JOIN mysql_servers_incoming
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname  | port | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment | mem_pointer | gtid_port | weight | status | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 1            | 127.0.0.2 | 3306 | 0         | 1      | 0      | 0           | 1000            | 0                   | 0       | 0              |         | 0           | 0         | 1      | 0      | 0           | 1000            | 0                   | 0       | 0              |         |
+--------------+-----------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+-------------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
2024-09-20 07:29:14 [INFO] Creating new server in HG 1 : 127.0.0.2:3306 , gtid_port=0, weight=1, status=0
2024-09-20 07:29:14 [INFO] New mysql_replication_hostgroups table
2024-09-20 07:29:14 [INFO] New mysql_group_replication_hostgroups table
2024-09-20 07:29:14 [INFO] New mysql_galera_hostgroups table
2024-09-20 07:29:14 [INFO] New mysql_aws_aurora_hostgroups table
2024-09-20 07:29:14 [INFO] New mysql_hostgroup_attributes table
2024-09-20 07:29:14 [INFO] New mysql_servers_ssl_params table
2024-09-20 07:29:14 [INFO] Checksum for table mysql_servers_v2 is 0xB70EF5F323C046C3
2024-09-20 07:29:14 [INFO] New computed global checksum for 'mysql_servers_v2' is '0xEA6D061E422B30F0'
2024-09-20 07:29:14 [INFO] Dumping current MySQL Servers structures for hostgroup ALL
HID: 1 , address: 127.0.0.2 , port: 3306 , gtid_port: 0 , weight: 1 , status: ONLINE , max_connections: 1000 , max_replication_lag: 0 , use_ssl: 0 , max_latency_ms: 0 , comment: 
2024-09-20 07:29:14 [INFO] Dumping mysql_servers: ALL
+-----+-----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-----------------+
| hid | hostname  | port | gtid | weight | status | cmp | max_conns | max_lag | ssl | max_lat | comment | mem_pointer     |
+-----+-----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-----------------+
| 1   | 127.0.0.2 | 3306 | 0    | 1      | 0      | 0   | 1000      | 0       | 0   | 0       |         | 136676696910464 |
+-----+-----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-----------------+
2024-09-20 07:29:14 [INFO] Checksum for table mysql_servers is 0xB70EF5F323C046C3
2024-09-20 07:29:14 [INFO] Rebuilding 'Hostgroup_Manager_Mapping' due to checksums change - mysql_servers { old: 0x0, new: 0x23C046C3B70EF5F3 }, mysql_replication_hostgroups { old:0x0, new:0x0 }
2024-09-20 07:29:14 [INFO] MySQL_HostGroups_Manager::commit() locked for 4ms
2024-09-20 07:29:19 [INFO] Received save mysql servers to disk command
2024-09-20 07:29:41 ProxySQL_GloVars.cpp:32:term_handler(): [WARNING] Received TERM signal: shutdown in progress...

Please let us know if you require more information from my side.

renecannao commented 3 hours ago

Hi @kaushikpuneet07 . Please read the logs before opening an issue.

...
2024-09-20 07:28:46 [INFO] Successfully started
...
2024-09-20 07:28:47 [INFO] Latest ProxySQL version available: 2.7.0-11-g3835029
2024-09-20 07:29:14 [INFO] Received load mysql servers to runtime command
...
2024-09-20 07:29:19 [INFO] Received save mysql servers to disk command
2024-09-20 07:29:41 ProxySQL_GloVars.cpp:32:term_handler(): [WARNING] Received TERM signal: shutdown in progress...

ProxySQL was up and running, receiving and executing command , thus "Proxysql-initial unable to start service" is completely false. It was up and running until someone killed it: Received TERM signal