percona xtradb cluster mysql startup error - mysql

i have 2 nodes to prepare percona xtradb cluster , i have successfully installed the applications . then I tried to configure the file my.cnf
NODE1 :
cat >>/etc/my.cnf<<EOF
[mysqld]
wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
wsrep_cluster_name=democluster
wsrep_cluster_address=gcomm://192.168.254.126,192.168.254.127
wsrep_node_name=centosvm02
wsrep_node_address=192.168.254.126
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=uertest:123abc#A
pxc_strict_mode=ENFORCING
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
EOF
NODE 2 :
cat >>/etc/my.cnf<<EOF
[mysqld]
wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
wsrep_cluster_name=democluster
wsrep_cluster_address=gcomm://192.168.254.126,192.168.254.127
wsrep_node_name=centosvm02
wsrep_node_address=192.168.254.127
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=uertest:123abc#A
pxc_strict_mode=ENFORCING
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
EOF
after config is done i started systemctl start mysql#bootstrap but it failed. I discovered an error on startup
enter image description here

The error message is quite clear. The needed library cannot be found. If you installed PXC 8, then the library is galera4, not galera3. Make sure you installed all appropriate packages.

Related

MySQL not starting because of galera config

I have mysql installed on Ubuntu machine and it is working fine. But as soon as I add the galera conf the mysql doesn't start.
Below is the command I am using.
root#Abhishek-Dev-D1:/usr/local# /etc/init.d/mysql start --wsrep-new-cluster
Starting MySQL
.... * The server quit without updating PID file (/var/run/mysqld/mysqld.pid).
Galera.conf
[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://172.31.254.196,172.31.254.197,172.31.254.198"
# Galera Synchronization Configuration
wsrep_sst_method=rsync
# Galera Node Configuration
wsrep_node_address="172.31.254.196"
wsrep_node_name="node1"
When I remove galera.conf from /etc/mysql/conf.d/galera.conf and then start mysql is starting properly.
When I installed it for the first time it was working fine but then during testing I issued a reboot command on one of the node. After that mysql doesn't booted up with galera.

Percona XtraDB Cluster 5.6 does not start

All the good days. I want to run for test purposes Percona XtraDb Cluster on ubuntu 14.04. The basis here took these two articles
https://habrahabr.ru/post/152969/
https://www.percona.com/doc/percona-xtradb-cluster/5.6/manual/bootstrap.html
I came instead
Ну и в завершение, перезапускаем демона:
The daemon does not start
$ sudo /etc/init.d/mysql start
* Starting MySQL (Percona XtraDB Cluster) database server mysqld
* The server quit without updating PID file (/var/lib/mysql/vagrant-ubuntu-trusty-64.pid).
...fail!
The logs several errors. Error one:
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Sure I ran mysql_upgrade, but it does not work
$ sudo mysql_upgrade
Looking for 'mysql' as: mysql Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed
Error two:
160502 14:56:26 [ERROR] Plugin 'InnoDB' init function returned error.
160502 14:56:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE
ENGINE failed. 160502 14:56:26 [ERROR] Unknown/unsupported storage
engine: InnoDB 160502 14:56:26 [ERROR] Aborting
All are advised to remove all of the folders / var / lib / mysql and supposedly starts. But I deleted and nothing worked.
My file my.cnf
[mysqld_safe]
# wsrep_urls=gcomm://192.168.33.101:3400,gcomm://192.168.33.102:3400,gcomm://
#wsrep_urls=gcomm://192.168.33.101:3400,gcomm://
[mysqld]
innodb_log_file_size=256M
wsrep_cluster_address=gcomm://192.168.33.101
port=3306
socket=/var/run/mysqld/mysqld.sock
datadir=/var/lib/mysql
basedir=/usr
user=mysql
log_error=/var/log/mysql.err
binlog_format=ROW
default_storage_engine=InnoDB
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_sst_receive_address=192.168.33.101:3500
wsrep_node_incoming_address=192.168.33.101
wsrep_slave_threads=2
wsrep_cluster_name=cluster0
wsrep_provider_options="gmcast.listen_addr=tcp://192.168.33.101:3400;"
wsrep_sst_method=xtrabackup
wsrep_sst_auth=backup:password
wsrep_node_name=node0
innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2
innodb_buffer_pool_size=5000M
innodb_log_file_size=256M
innodb_log_buffer_size=4M
[client]
port=3306
socket=/var/run/mysqld/mysqld.sock
Actually the question: how to start? If there is anyone working configuration, then please share.
For the record:
Percona is amazing, but highly undocumented.
When it comes to configuring it, ive learned less is better.
important parts:
server-id required
these may be braking it, in my experience.
wsrep_sst_receive_address=192.168.33.101:3500
wsrep_node_incoming_address=192.168.33.101
Config from my cluster:
[mysqld]
server-id=18
datadir=/var/lib/mysql
wsrep_provider=/usr/lib/libgalera_smm.so
# Cluster connection URL -|-node0, -|-node1, -|-node2 -|-node3 -|-node4 -|-node5 -|-node6 -|-node7 -|-node8
wsrep_cluster_address=gcomm://192.168.1.18,192.168.1.19,192.168.1.20 #removed some
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
wsrep_sst_method=rsync
wsrep_sst_auth="root:password"
wsrep_cluster_name=grapes
innodb_buffer_pool_size=5140
innodb_buffer_pool_instances=4
innodb_flush_log_at_trx_commit=0
query_cache_size=0

SQL Node not connected in a mysql cluster

I am trying to deploy a mysql cluster (4 machines) with 1 node manager, 1 sql node, and 2 data nodes. I am following these tutorials which are complimentary (first part, second part, third part, fourth part) from the official mysql website. However I have a problem with the SQL Node which is always not connected, as you can see here in the node manager:
$ sudo ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 #10.31.35.40 (mysql-5.6.23 ndb-7.4.5, starting, Nodegroup: 0)
id=3 #10.31.35.42 (mysql-5.6.23 ndb-7.4.5, starting, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 #10.31.37.108 (mysql-5.6.23 ndb-7.4.5)
[mysqld(API)] 1 node(s)
id=4 (not connected, accepting connect from 10.31.35.41)
I don't know why the SQL node is not connected to the management node !! I looked for similar problems in google but I still can't resolve my problem !
I tried several times to do:
/etc/init.d/mysql.server stop
and
/etc/init.d/mysql.server start
but in vain.
Here is also the output of mysqld in verbose mode which mentions a problem I don't know what its cause:
ubuntu#10-31-35-41:/usr/local/mysql/bin$ sudo mysqld --verbose --help
150404 5:26:00 [Note] Plugin 'FEDERATED' is disabled.
150404 5:26:00 [ERROR] mysqld: unknown option '--ndbcluster'
......
Also when I try to see the location of the mysqld_safe (which I think is not normal since as you can see in the first part of the tutorial the folder was put in /usr/local/mysql (and I am supposed to use the mysql.server, isn't it ?)), I have
$ which mysqld_safe
/usr/bin/mysqld_safe
Moreover, I don't know if there is a conflict with the previous installed package of mysql
This is /etc/mysql/my.cnf (in the sql node, which is the same in the working data nodes):
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
[mysql_cluster]
# Options for MySQL Cluster processes:
ndb-connectstring=10.31.37.108 # location of management server
This is the config.ini file in the ndb_mgm:
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=80M # How much memory to allocate for data storage
IndexMemory=18M # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example Cluster setup.
[tcp default]
# TCP/IP options:
portnumber=2202 # This the default; however, you can use any
# port that is free for all the hosts in the cluster
# Note: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used
# instead
[ndb_mgmd]
# Management process options:
hostname=10.31.37.108 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node log files
[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
hostname=10.31.35.40 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
[ndbd]
# Options for data node "B":
hostname=10.31.35.42 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
[mysqld]
# SQL node options:
hostname=10.31.35.41 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
Thank you very much in advance for your help !!
To resolve the problem I changed the permissions on the /usr/local/mysql/data directory as follows:
sudo chown -R ubuntu data/
so now instead of:
$ /usr/local/mysql/support-files/mysql.server restart
* MySQL server PID file could not be found!
Starting MySQL
. * The server quit without updating PID file (/usr/local/mysql/data/ip-172-31-46-103.pid).
I get now:
$ /usr/local/mysql/support-files/mysql.server restart
Shutting down MySQL
.. *
Starting MySQL
. *

mysql ndb_mgmd --no-nodeid-checks - Startup error

I am having trouble starting up ndb_mgmd. Here's some information.
OS: Ubuntu 12.04LTS
MySQL -V: Ver 5.5.25a-ndb-7.2.7 for Linux on x86_64 (Source distribution)
Base Dir = /usr/local/mysql
Default MySQL Conf = /xconf/mysql/my.cnf
Default MySQL Data = /xdata/mysql
/xconf/mysql/my.cnf
[mysqld]
ndbcluster
socket=/xdata/mysql/mysql.sock
[mysqld_safe]
err-log=/xlog/mysqld.log
pid-file=/xdata/runtime/mysqld/mysqld.pid
[ndb_mgmd]
configdir=/xdata/mysql-cluster
config-file=/xdata/mysql-cluster/config.ini
/xdata/mysql-cluster/config.ini
[NDBD DEFAULT]
NoOfReplicas=2
DataDir=/xdata/mysql-cluster
# Management Node
[ndb_mgmd]
NodeId=1
HostName=192.168.2.100
DataDir=/xdata/mysql-cluster
# Storage Nodes
[ndbd]
NodeId=2
HostName=192.168.2.101
[ndbd]
NodeId=3
HostName=182.168.2.102
# SQL Nodes
[mysqld]
HostName=192.168.2.100
[mysqld]
HostName=192.168.2.101
[mysqld]
HostName=192.168.2.102
When I execute:
#xuser:/xdata/mysql-cluster$ ndb_mgmd
MySQL Cluster Management Server mysql-5.5.25 ndb-7.2.7
[MgmtSrvr] ERROR -- Could not determine which nodeid to use for this node. Specify it with --ndb-nodeid=<nodeid> on command line
Any ideas as to why this is happening?
The problem was I wasn't connected to the network of the cluster.

Error starting mysql cluster management node (ndb_mgmd) on Ubuntu

I am having trouble with the initial start up of the mysql-cluster management node and would appreciate any help I can get about this issue. See my two examples of failure below followed by my config.ini file. The first example shows the basic command to start the daemon and the error it produces. The second attempts to skip the process I believe caused the error in the first, but only results in a different error (one that I can find no solution to).
~$ ndb_mgmd -f /var/lib/mysql-cluster/config.ini
MySQL Cluster Management Server mysql - 5.5.25 ndb-7.2.7
2012-07-27 16:44:51 [MgmtSrvr] INFO -- The default config directory '/user/local
/mysql/mysql-cluster' does not exist. Trying to create it...
Failed to create directory '/usr/local/mysql/mysql-cluster', error: 2 2012-07-27 16:44:51
[MgmtSrvr] ERROR -- Could not create directory '/usr/local/mysql/mysql-cluster'.
Either create it manually or specify a different directory with --configdir=
~$ ndb_mgmd --skip-config-cache -f /var/lib/mysql-cluster/config.ini
MySQL Cluster Management Server mysql - 5.5.25 ndb-7.2.7
2012-07-27 16:44:51 [MgmtSrvr] INFO -- Skipping check of config directory since config cache is disabled.
Failed to parse parameters for log handler: 'FILE:filename=/var/lib/mysql-cluster/ndb_1_cluster.log,maxsize=1000000,
maxfiles=6', error:13 '(null)'
/var/lib/mysql-cluster/config.ini:
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=80M # How much memory to allocate for data storage
IndexMemory=18M # How much memory to allocate for index storage
[tcp default]
# TCP/IP options:
[ndb_mgmd]
# Management process options:
hostname=192.168.0.3 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node log files
NodeId=1
[ndbd]
# Options for data node-1:
# (one [ndbd] section per data node)
hostname=192.168.0.1 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
NodeId=2
[ndbd]
# Options for data node-2:
hostname=192.168.0.2 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
NodeId=3
[mysqld]
# SQL node options:
hostname=192.168.0.4 # Hostname
You should try running that commands with sudo:
~$ sudo ndb_mgmd -f /var/lib/mysql-cluster/config.ini
~$ sudo ndb_mgmd --skip-config-cache -f /var/lib/mysql-cluster/config.ini
Your problem seems to be with permissions, not configuration.