zl程序教程

您现在的位置是:首页 >  其它

当前栏目

GlusterFS 搭建x86

搭建 x86 glusterfs
2023-09-14 09:16:05 时间

1. 配置hosts

所有节点配置 hosts

2.格式化和挂载

挂载一个xfs盘
# mkfs.xfs  /dev/sdb
# mkdir -p /data/brick1
# echo '/dev/sdb /data/brick1 xfs defaults 1 2' >> /etc/fstab
# mount -a

3. 关闭防火墙和SElinux

# systemctl status firewalld
# systemctl stop firewalld
# systemctl disable firewalld

关闭Selinux
# setenforce 0
SELINUX值修改为disabled
vim /etc/selinux/config

4. 设置时区 和 ntpdata

# yum install -y ntp ntpdate
设置时区
timedatectl
timedatectl set-timezone Asia/Shanghai

# vim /etc/ntp.conf
增加
restrict 30.0.0.0 mask 255.255.255.0 nomodify notrap  
# 30.0.0.0网段可以从这台主机同步时间

# 注释掉默认的,新增时间服务器列表
## server 0.centos.pool.ntp.org iburst
## server 1.centos.pool.ntp.org iburst
## server 2.centos.pool.ntp.org iburst
## server 3.centos.pool.ntp.org iburst

server 0.cn.pool.ntp.org iburst
server 1.cn.pool.ntp.org iburst
server 2.cn.pool.ntp.org iburst
server 3.cn.pool.ntp.org iburst

# 新增 容许服务器修改本地时间
restrict 0.cn.pool.ntp.org nomodify notrap noquery
restrict 1.cn.pool.ntp.org nomodify notrap noquery
restrict 2.cn.pool.ntp.org nomodify notrap noquery

设置ntpd 开机启动
systemctl enable ntpd
systemctl enable ntpdate
systemctl is-enabled ntpd

启动NTP服务器(先设置主机时间)
ntpdate -u 1.cn.pool.ntp.org
systemctl start ntpdate
systemctl start ntpd

设置其它主机同步时间
echo "server 30.0.0.222" >> /etc/ntp.conf
systemctl restart ntpd

5. 安装GlusterFS

yum install centos-release-gluster –y
yum install glusterfs-server  glusterfs glusterfs-fuse -y

6. 启动服务

# systemctl start glusterd.service
# systemctl enable glusterd.service

7. 组建集群

gluster peer probe hostname  # hostname 集群每个节点hostname
查看集群状态
gluster peer status
gluster pool list
gluster volume status

参考:
1.Gluster
2.GlusterFS分布式文件概念解析
3.centos7 搭建GlusterFS
4.CentOS 7.3 分布式存储Glusterfs部署使用(一)
5.CentOS 7.3 分布式存储Glusterfs部署使用(二)
6.CentOS 7 安装部署 GlusterFS
7.Installing GlusterFS - a Quick Start Guide
8.基于 GlusterFS 实现 Docker 集群的分布式存储
9.GlusterFS 02 部署配置