显然你忘记了一个参数

显然你忘记了一个参数

我刚刚在两个节点上安装了 GlusterFS,它看起来运行良好,状态正常,并且复制也运行良好。

但是,当我停止 node1 卷群集卷停止 glustervol1`或关闭服务器以模拟故障时,第二个节点不会接管。

我按照这些说明安装 GlusterFS这里

已编辑

我正在使用 VMware 7 Vm 和 CentOS 7。

App-Master:LampStack、Mysql-Master 中的远程数据库、Gluster 1 中的存储。

gluster1:/glustervol1       /home/wordpress/  glusterfs   defaults,_netdev  0  0

App-Slave:Lampstack、Mysql-Slave 中的远程数据库、Gluster 2 中的存储。

gluster2:/glustervol1       /home/wordpress/  glusterfs   defaults,_netdev  0  0

Mysql-Master:Mysql。

Mysql-Slave:Mysql(复制)。

Gluster 1:创建卷的 GlusterFS 服务器。

Gluster 2:GlusterFS 是 Gluster 1 的副本。

LoadBalancer:App-master 和 App-Slave 之间的 Nginx 负载平衡

*****信息*****

172.16.172.147 gluster1
172.16.172.148 gluster2
172.16.172.146 appslave
172.16.172.143 appmaster

来自 App-Master 服务器的日志

关闭 Gluster1 后

[2016-11-21 16:36:18.532124] W [socket.c:642:__socket_rwv] 0-glusterfs: readv on 172.16.172.147:24007 failed (Connection timed out)
[2016-11-21 16:36:18.532125] W [socket.c:642:__socket_rwv] 0-glustervol1-client-0: readv on 172.16.172.147:49152 failed (Connection timed out)
[2016-11-21 16:36:18.532323] I [MSGID: 114018] [client.c:2042:client_rpc_notify] 0-glustervol1-client-0: disconnected from glustervol1-client-0. Client process will keep trying to connect to glusterd until brick's port is available
[2016-11-21 16:36:31.965015] E [socket.c:2332:socket_connect_finish] 0-glusterfs: connection to 172.16.172.147:24007 failed (No route to host)
[2016-11-21 16:36:31.965141] E [socket.c:2332:socket_connect_finish] 0-glustervol1-client-0: connection to 172.16.172.147:24007 failed (No route to host)

开启 Gluster1 后

[2016-11-21 16:39:02.258175] I [glusterfsd-mgmt.c:1512:mgmt_getspec_cbk] 0-glusterfs: No change in volfile, continuing
[2016-11-21 16:39:02.258595] I [rpc-clnt.c:1851:rpc_clnt_reconfig] 0-glustervol1-client-0: changing port to 49152 (from 0)
[2016-11-21 16:39:02.262348] I [MSGID: 114057] [client-handshake.c:1437:select_server_supported_programs] 0-glustervol1-client-0: Using Program GlusterFS 3.3, Num (1298437), Version (330)
[2016-11-21 16:39:02.299637] I [MSGID: 114046] [client-handshake.c:1213:client_setvolume_cbk] 0-glustervol1-client-0: Connected to glustervol1-client-0, attached to remote volume '/bricks/brick1/brick'.
[2016-11-21 16:39:02.299714] I [MSGID: 114047] [client-handshake.c:1224:client_setvolume_cbk] 0-glustervol1-client-0: Server and Client lk-version numbers are not same, reopening the fds
[2016-11-21 16:39:02.300513] I [MSGID: 114035] [client-handshake.c:193:client_set_lk_version_cbk] 0-glustervol1-client-0: Server lk version = 1

关闭 Gluster2 后

[2016-11-21 16:41:33.394122] C [rpc-clnt-ping.c:161:rpc_clnt_ping_timer_expired] 0-glustervol1-client-1: server 172.16.172.148:49152 has not responded in the last 42 seconds, disconnecting.
[2016-11-21 16:41:33.394943] E [rpc-clnt.c:362:saved_frames_unwind] (--> /lib64/libglusterfs.so.0(_gf_log_callingfn+0x186)[0x7fd4ad63c906] (--> /lib64/libgfrpc.so.0(saved_frames_unwind+0x1de)[0x7fd4ad40792e] (--> /lib64/libgfrpc.so.0(saved_frames_destroy+0xe)[0x7fd4ad407a3e] (--> /lib64/libgfrpc.so.0(rpc_clnt_connection_cleanup+0x9c)[0x7fd4ad4093fc] (--> /lib64/libgfrpc.so.0(rpc_clnt_notify+0x88)[0x7fd4ad409c08] ))))) 0-glustervol1-client-1: forced unwinding frame type(GlusterFS 3.3) op(LOOKUP(27)) called at 2016-11-21 16:40:50.706048 (xid=0x59e)
[2016-11-21 16:41:33.394973] W [MSGID: 114031] [client-rpc-fops.c:2971:client3_3_lookup_cbk] 0-glustervol1-client-1: remote operation failed. Path: / (00000000-0000-0000-0000-000000000001) [Transport endpoint is not connected]
[2016-11-21 16:41:33.395188] E [rpc-clnt.c:362:saved_frames_unwind] (--> /lib64/libglusterfs.so.0(_gf_log_callingfn+0x186)[0x7fd4ad63c906] (--> /lib64/libgfrpc.so.0(saved_frames_unwind+0x1de)[0x7fd4ad40792e] (--> /lib64/libgfrpc.so.0(saved_frames_destroy+0xe)[0x7fd4ad407a3e] (--> /lib64/libgfrpc.so.0(rpc_clnt_connection_cleanup+0x9c)[0x7fd4ad4093fc] (--> /lib64/libgfrpc.so.0(rpc_clnt_notify+0x88)[0x7fd4ad409c08] ))))) 0-glustervol1-client-1: forced unwinding frame type(GF-DUMP) op(NULL(2)) called at 2016-11-21 16:40:50.706053 (xid=0x59f)
[2016-11-21 16:41:33.395201] W [rpc-clnt-ping.c:204:rpc_clnt_ping_cbk] 0-glustervol1-client-1: socket disconnected
[2016-11-21 16:41:33.395211] I [MSGID: 114018] [client.c:2042:client_rpc_notify] 0-glustervol1-client-1: disconnected from glustervol1-client-1. Client process will keep trying to connect to glusterd until brick's port is available

开启 Gluster2 后

[2016-11-21 16:41:45.255081] E [socket.c:2332:socket_connect_finish] 0-glustervol1-client-1: connection to 172.16.172.148:24007 failed (No route to host)

注意:即使 Gluster1 或 Gluster2 关闭,故障转移仍可正常进行,应用程序仍可继续运行。

答案1

这并不是 GlusterFS 的工作原理,因为它没有“故障转移”。没有单个节点充当主节点,因为 GlusterFS 是无主节点的。客户端负责连接到所有 Gluster 对等节点,并且客户端必须保持对服务器的网络可见性,以保持合理的卷活动。节点间通信通常仅在卷修复操作期间和协商对等节点信任时使用。

如果您遵循该指南,我假设您已从两个砖块创建了副本 2 gluster 卷。您的配置是什么样的,连接这些 Gluster 节点的整体网络是什么样的,以及将它们连接到客户端的是什么?Gluster 的大多数问题都与客户端到服务器的通信问题有关。

答案2

显然你忘记了一个参数

你应该添加备份文件服务器用于坐骑

例子:

gluster1:/glustervol1       /home/wordpress/  glusterfs   defaults,_netdev,backupvolfile-server=gluster2  0  0

相关内容