CL236构建可信存储池
本章节学习和演示构建可信存储池。 RHCA专栏地址:https://blog.csdn.net/qq_41765918/category_11532281.html
节点准备
在安装Red Hat Gluster存储之后,在形成可信存储池之前,需要采取一些步骤。其中一些步骤(如调优)是可选的,但会对最终的性能产生很大影响。
调整配置文件
Red Hat Gluster存储带有两个调优配置文件,可以根据预期的工作负载配置它们。
rhgs-random-io,为许多小的读和写;rhgs-sequential-io,为更大的文件传输。
两者都是基于吞吐量-性能概要。
要应用其中一个概要文件,请执行命令tuned-adm profile 。例如:
firewalll配置
默认情况下,由firewalld管理的系统防火墙将阻止所有到glusterd守护进程的通信。glusterfs-server包添加了一个新的防火墙服务定义,称为glusterfs,可用于打开防火墙上的所有相关端口
配置可信存储池
服务一启动,就在一个存储池内,只不过这个存储池里只有自己:
查看当前服务器的存储池内的server:
# gluster pool list
这时,我们需要添加其它服务器到同一个存储池:
将node2加入到当前存储池
# gluster peer probe node2
查看peer状态
# gluster peer status
将node2从当前存储池中踢出去
# gluster peer detach node2
课本练习
1. 在servera和serverb机器上,确认glusterd服务运行。
[root@servera ~]
active
[root@serverb ~]
active
2. 在servera和serverb上,配置防火墙以允许glusterfs流量。
[root@servera ~]
success
[root@servera ~]
success
[root@servera ~]
public (default, active)
interfaces: eth0
sources:
services: dhcpv6-client glusterfs ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
[root@serverb ~]
success
[root@serverb ~]
success
[root@serverb ~]
public (default, active)
interfaces: eth0
sources:
services: dhcpv6-client glusterfs ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
3. 从servera,添加serverb.lab.example.com到受信任存储池,然后验证两个节点上受信任存储池的状态。
[root@servera ~]
peer probe: success.
[root@servera ~]
[root@servera ~]
Number of Peers: 1
Hostname: serverb.lab.example.com
Uuid: 2f793329-c4bf-43e8-a445-30e379ec03b6
State: Peer in Cluster (Connected)
[root@servera ~]
UUID Hostname State
2f793329-c4bf-43e8-a445-30e379ec03b6 serverb.lab.example.com Connected
81db9560-30f9-4dc8-9afa-c8a849ac9abf localhost Connected
[root@serverb ~]
Number of Peers: 1
Hostname: servera.lab.example.com
Uuid: 81db9560-30f9-4dc8-9afa-c8a849ac9abf
State: Peer in Cluster (Connected)
[root@serverb ~]
UUID Hostname State
81db9560-30f9-4dc8-9afa-c8a849ac9abf servera.lab.example.com Connected
2f793329-c4bf-43e8-a445-30e379ec03b6 localhost Connected
4. 在servera上,查看日志。以查找有关新对等点的信息。
[root@servera ~]
[2020-11-25 07:52:32.959472] I [MSGID: 106163] [glusterd-handshake.c:1194:__glusterd_mgmt_hndsk_versions_ack] 0-management: using the op-version 30707
[2020-11-25 07:52:32.986424] I [MSGID: 106490] [glusterd-handler.c:2884:__glusterd_handle_probe_query] 0-glusterd: Received probe from uuid: 2f793329-c4bf-43e8-a445-30e379ec03b6
[2020-11-25 07:52:32.987232] I [MSGID: 106493] [glusterd-handler.c:2947:__glusterd_handle_probe_query] 0-glusterd: Responded to serverb.lab.example.com, op_ret: 0, op_errno: 0, ret: 0
[2020-11-25 07:52:32.999785] I [MSGID: 106490] [glusterd-handler.c:2539:__glusterd_handle_incoming_friend_req] 0-glusterd: Received probe from uuid: 2f793329-c4bf-43e8-a445-30e379ec03b6
[2020-11-25 07:52:33.017114] I [MSGID: 106493] [glusterd-handler.c:3780:glusterd_xfer_friend_add_resp] 0-glusterd: Responded to serverb.lab.example.com (0), ret: 0
[2020-11-25 07:52:33.044979] I [MSGID: 106493] [glusterd-rpc-ops.c:695:__glusterd_friend_update_cbk] 0-management: Received ACC from uuid: 2f793329-c4bf-43e8-a445-30e379ec03b6
[2020-11-25 07:52:33.045126] I [MSGID: 106492] [glusterd-handler.c:2715:__glusterd_handle_friend_update] 0-glusterd: Received friend update from uuid: 2f793329-c4bf-43e8-a445-30e379ec03b6
[2020-11-25 07:52:33.045172] I [MSGID: 106502] [glusterd-handler.c:2760:__glusterd_handle_friend_update] 0-management: Received my uuid as Friend
[2020-11-25 07:53:06.463131] I [MSGID: 106487] [glusterd-handler.c:1411:__glusterd_handle_cli_list_friends] 0-glusterd: Received cli list req
[2020-11-25 07:53:24.321000] I [MSGID: 106487] [glusterd-handler.c:1411:__glusterd_handle_cli_list_friends] 0-glusterd: Received cli list req
5. 评分脚本
[student@workstation ~]$ lab setup-pool grade
总结
-
配置前,先准备节点调优模式和防火墙配置。 -
配置节点添加到可信存储池用来建立整个存储池。
以上就是【金鱼哥】的分享。希望能对看到此文章的小伙伴有所帮助。
如果这篇【文章】有帮助到你,希望可以给【金鱼哥】点个赞👍,创作不易,相比官方的陈述,我更喜欢用【通俗易懂】的文笔去讲解每一个知识点,如果有对【运维技术】感兴趣,也欢迎关注?????? 【金鱼哥】??????,我将会给你带来巨大的【收获与惊喜】💕💕!
|