- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
mysql -h controller -u keystone -pvic
B* x2 a9 J* g4 \. TERROR 2003 (HY000): Can't connect to MySQL server on 'controller' (111 "Connection refused")& Z1 k, Q4 ?# ]; C/ `# G0 U
ERROR 2003 (HY000): Can't connect to MySQL server on 'controller' (111 "Connection refused")
8 _9 I* @% B t& s) \4 ]0 L排查过程:
# F/ h4 ^: D6 v- S+ r$ n netstat -ntlp 先查看启动端口:% ?. X* n4 V. ]& r* h4 |
Active Internet connections (only servers)
8 G/ z, k$ y/ O- R( T0 U6 qProto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
2 w! j! |+ M' W* btcp 0 0 192.168.90.65:3306 0.0.0.0:* LISTEN 5760/mysqld ! g$ g( N7 Q5 g+ P: L
tcp 0 0 192.168.90.65:11211 0.0.0.0:* LISTEN 4894/memcached 7 c1 M3 q3 ]" g9 G" w U) r8 _# e9 _
查看域名解析:- r, S! Z0 j) \
cat /etc/hosts
! C. w; `" {" T' y2 v( N192.168.90.70 controller3 C7 B* |/ l2 t( X$ M
192.168.90.65 controller1 + c. _1 r, B2 W$ I. a' D6 B
192.168.90.68 compute1
! S% }1 j+ |9 d& a5 H" `) q" U5 b' _' t/ n: G: |7 f' f8 {' I
偏偏这个时候的mysql 就连接不上,什么原因呢?公版的数据库用问题,这个地方设计不合理,郁闷的不行了。, p1 u H7 g, z0 `; V! {' w
原来是因为我们配置了mysql中bind-address
2 i: E- |/ F8 ?! Q ]两个配置文件,一个是galer.cnf文件、另一个是mariadb-server.cnf 中注释掉这个
* ?( d& c9 B. t$ H+ C9 ?#bind-address=192.168.90.65 7 k( i/ [8 i+ H
: J" ^+ c2 f- l& ~, W: l& ~
重启数据库,其他条件不变的情况下,6 Y& R5 t* Z' U. Q1 i
mysql -h controller -u keystone -pvic . r7 m; {( X6 x5 U& `% J
Welcome to the MariaDB monitor. Commands end with ; or \g.
0 O+ y$ Z. o) P5 T* Q% g) qYour MariaDB connection id is 8, Y8 {! I6 t' w2 [( v- X
Server version: 10.1.20-MariaDB MariaDB Server2 Q7 f8 H v( E$ @, }
m3 {* e! e; O; h* B! |
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
# ~, ^) Q1 X& p* t( N* d1 U3 \1 q9 Y& Z0 C4 v% P+ |# S/ p
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.* h% I5 n( G5 r+ L n
4 Q& D) Q4 u( m; I% l8 a
MariaDB [(none)]>
* `% @6 Q6 B! P2 Q; ]" {5 C# U" }! O5 i5 H# ^
: M: _4 S. K8 X% q+ h" Q' k
问题解决了,但是问题来了,如果我们装高可用版本怎么办,单独分配两台主机啥也不干,就只是提供haproxy和keepalived吗?这个资源耗损太大了吧。1 U- g( e2 s# b8 p4 I
~. g, t1 d( |# [0 y2 C9 P5 V5 z; Z. k. k
H w) ?# e; W8 G- { |
|