- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
mysql -h controller -u keystone -pvic ' F' x/ p: h( }6 @0 x2 Q( j
ERROR 2003 (HY000): Can't connect to MySQL server on 'controller' (111 "Connection refused")
9 F( `/ q' s& H# Z, y9 cERROR 2003 (HY000): Can't connect to MySQL server on 'controller' (111 "Connection refused")9 n& T$ M2 \# U1 S- O, n0 h
排查过程:. o/ j% Q* b9 U" s3 O" a, Z
netstat -ntlp 先查看启动端口:
+ E- }0 q5 H/ ^* T- hActive Internet connections (only servers)
6 q$ h; u! \9 o4 Y3 ~3 bProto Recv-Q Send-Q Local Address Foreign Address State PID/Program name # I/ z' D7 I" w1 x8 a1 y
tcp 0 0 192.168.90.65:3306 0.0.0.0:* LISTEN 5760/mysqld / R" q. s; G; V* X! o% z" W
tcp 0 0 192.168.90.65:11211 0.0.0.0:* LISTEN 4894/memcached % ~* @3 G+ P' B2 G1 w3 v
查看域名解析:% u& z# K$ R3 \$ c9 m8 Q
cat /etc/hosts* g- y" w1 H9 W5 N
192.168.90.70 controller) q3 W) T- q7 x7 D" x( t$ b; A: [
192.168.90.65 controller1
; {" c- q& `2 n8 ~' \7 m* G, X192.168.90.68 compute1
: Q) K: U$ B# t& Y- p( \+ K1 h1 @8 S% Q6 v$ r+ Y
偏偏这个时候的mysql 就连接不上,什么原因呢?公版的数据库用问题,这个地方设计不合理,郁闷的不行了。) o9 Z. K; Z4 t$ ^/ \
原来是因为我们配置了mysql中bind-address) n5 N. S0 r; y
两个配置文件,一个是galer.cnf文件、另一个是mariadb-server.cnf 中注释掉这个
8 y& H( x( [/ r% N#bind-address=192.168.90.65
3 H& h2 W ^: l! o. {4 C# s& U' o2 G# }/ P m7 O
重启数据库,其他条件不变的情况下,
5 i/ D, m) N3 N) N N, C# hmysql -h controller -u keystone -pvic 9 l- z0 Y( V8 |+ z O) n
Welcome to the MariaDB monitor. Commands end with ; or \g.
- k5 @2 `; P0 N p+ KYour MariaDB connection id is 8% L: J# J' o( G$ c2 v W# t+ r+ x# a
Server version: 10.1.20-MariaDB MariaDB Server
0 L) B. J" b$ s% I7 ]
! O6 ^" Y* w, s2 S& A" pCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. a8 H# \1 J M, z s
$ z+ P2 j, x8 F0 yType 'help;' or '\h' for help. Type '\c' to clear the current input statement.( s, \5 y* ^1 A0 B$ m& C
% Z/ X5 w8 q* Z0 P1 C8 nMariaDB [(none)]>
+ w: q4 V2 q. v$ X7 k' j+ u7 t3 {0 P
' d0 R/ J( z! |+ E7 Z问题解决了,但是问题来了,如果我们装高可用版本怎么办,单独分配两台主机啥也不干,就只是提供haproxy和keepalived吗?这个资源耗损太大了吧。1 G8 u! i( f" M2 L/ y; u, s
7 u6 a' }) O9 w, ?0 M1 O: [) {. e+ M. j
& Y/ i* d5 r }
|
|