0

I'm using Ubuntu 16.04 and installed MySQL version 5.7 via apt-get in AWS.

After that, I've managed to upgrade the MySQL to Galera Cluster by following the Documentation from the official website using apt-get install galera-3 galera-arbitrator-3 mysql-wsrep-5.6

After that I've configured the file /etc/mysql/conf.d/galera.cnf to be:

[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0

# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so

# Galera Cluster Configuration
wsrep_cluster_name="test_cluster"
wsrep_cluster_address="gcomm://this_node_ip,second_ip,third_ip"

# Galera Synchronization Configuration
wsrep_sst_method=rsync

# Galera Node Configuration
wsrep_node_address="this_node_ip"
wsrep_node_name="this_node_name"

The step above is repeated for the other 2 nodes (with it's own IP address). And stop the mysql with the following command sudo service mysql stop for each of the node.

And in the first node, I'm trying to start with the following command:

sudo service mysql start --wsrep-new-cluster

But it returns: Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

In the systemctl status mysql.service, it says:

● mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-02-09 15:53:16 +08; 33s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6264 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Feb 09 15:53:15 systemd[1]: Starting LSB: start and stop MySQL...
Feb 09 15:53:15 mysql[6264]: Starting MySQL
Feb 09 15:53:15 mysql[6264]: .180209 15:53:15 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
Feb 09 15:53:15 mysql[6264]: 180209 15:53:15 mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
Feb 09 15:53:16 mysql[6264]:  * The server quit without updating PID file (/var/run/mysqld/mysqld.pid).
Feb 09 15:53:16 systemd[1]: mysql.service: Control process exited, code=exited status=1
Feb 09 15:53:16 systemd[1]: Failed to start LSB: start and stop MySQL.
Feb 09 15:53:16 systemd[1]: mysql.service: Unit entered failed state.
Feb 09 15:53:16 systemd[1]: mysql.service: Failed with result 'exit-code'.

Hope these information helps.

0

Have you tried creating the /var/run/mysqld directory, with rwx permissions for the mysql user? Judging by the error messages, that seems to be a good place to start.

The other error message should probably also be addressed, regarding not writing to syslog and the mysql error log at the same time. I'd suggest inspecting your MySQL config files under /etc/ to see if you can disable the syslog option.

Also, it looks a bit strange that you're using mysql-wsrep-5.6 with MySQL 5.7. Is there a mysql-wsrep-5.7? If not, perhaps you need to use MySQL 5.6.

  • I get this when trying to install with mysql-wsrep-5.7 Errors were encountered while processing: /var/cache/apt/archives/mysql-wsrep-common-5.7_5.7.21-25.14+1ubuntu16.04_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) – AFwcxx Feb 9 '18 at 9:48
  • @AFwcxx Did you uninstall the old packages first? Did you update your /etc/apt/sources.list.d/galera.list correctly? Did you update your local cache with apt-get update? – dbdemon Feb 9 '18 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.