Home > Database > Mysql Tutorial > body text

配置Mysql Cluster时出错Unable to connect with connect string_MySQL

WBOY
Release: 2016-06-01 13:08:51
Original
2276 people have browsed it

在执行 /etc/init.d/ndbd --initial出现下列错误

[root@ndbd1 ~]# /etc/init.d/ndbd --initial
Unable to connect with connect string: nodeid=0,localhost:1186
Retrying every 5 seconds. Attempts left: 12 11 10 9 8 7 6 5 4 3 2 1, failed.

 

解决办法

1.查看/etc/my.cnf文件配置

[root@ndbd1 ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0n

 

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

 

2.修改该配置文件

[root@ndbd1 ~]# vim /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
ndbcluster
ndb-connectstring=192.168.0.30

 

[MYSQL_CLUSTER]
ndb-connectstring=192.168.0.30

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

 

3.重新进行初始化

[root@ndbd1 ~]# /etc/init.d/ndbd --initial
2014-05-09 21:45:17 [ndbd] INFO     -- Angel connected to '192.168.0.30:1186'
2014-05-09 21:45:17 [ndbd] INFO     -- Angel allocated nodeid: 2

问题解决

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template