GlusterFS安装步骤
2016-10-07 11:58
162 查看
1.解决联网问题
增加eth0(生效的网卡,可能是0)DNS
vi /etc/sysconfig/network-scripts/ifcfg-eth0增加
DNS1=221.11.1.67
DNS2=8.8.8.8
2.设置所有关联的rpm包都下载到本地(必需要做,否则后续步骤yum安装会失败)
vi /etc/yum.conf
修改keepcache=1
3.联网后,安装以下软件
yum install openssl-devel
yum -y install createrepo
4.修改yum源为本地
CentOS-Base.repo重命名为CentOS-Base.repo.bak,使其不生效
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
增加本地yum源的配置,在/etc/yum.repos.d/目录下,新建glfs.repo文件(文件名以.repo结尾即可)
vi /etc/yum.repos.d/glfs.repo 增加以下内容
[glfs]
name=glfs
baseurl=file:///home/rpms
enabled=1
gpgcheck=0
新建rmps文件夹,存放本地rpm包
mkdir /home/rpms
通过xftp上传GlusterFS的19个rpm包,上传到glfs.repo配置里的/home/rpms目录下
生成本地repo信息
cd /home/rpms
createrepo ./
5.安装glusterfs-server
yum -y install glusterfs-server
若server和client同要安装同一台机子上,执行以下命令
yum -y install glusterfs glusterfs-client glusterfs-server
6.启动glusterd服务
查看服务是否启动,未启动需要手动启动
service glusterd status
并设置开机启动 chkconfig glusterd on
7.将yum源重新改为联网,这步不是必须的
/etc/yum.repos.d/CentOS-Base.repo.bak重命名为CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo.bak /etc/yum.repos.d/CentOS-Base.repo
8.在iptables增加gluster端口,若增加规则GlusterFS Server还不能相互探测到peer,则关闭iptables服务
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 24007:24008 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 49152:49162 -j ACCEPT
重启iptables服务
service iptables restart
9.建立peer,通过hostname访问对端peer,建议配置hostname(若不配置hostname,迁移场景IP变化时,就麻烦了)
gluster peer probe ip/hostname
gluster peer probe 172.16.100.103 或 gluster peer probe of.glfs103
gluster peer probe 172.16.100.104 【hostname】of.glfs104
gluster peer probe 172.16.100.105 【hostname】of.glfs105
gluster peer probe 172.16.100.106 【hostname】of.glfs106
成功后,通过gluster peer status查看状态,保证所有的peer都是Connect状态
10.每台Server都需要创建相同目录并配置fstab
在每台Server上创建相同的目录
mkdir -p /data/brick1
在每台Server上配置fstab
vi /etc/fstab增加以下项
/dev/sdb1 /data/brick1 ext4 defaults 1 2
sdb1:GulsterFS使用存储所在的磁盘,若使用镜像卷,sdb1的空间大小基本一致
挂载并查看fstab信息
mount -a && mount
11.创建并启动镜像volume
of.glfs103和of.glfs104作为一组镜像卷
of.glfs105和of.glfs106作为一组镜像卷
gluster volume create gv0 replica 2 of.glfs103:/data/brick1/gv0 of.glfs104:/data/brick1/gv0 of.glfs105:/data/brick1/gv0 of.glfs106:/data/brick1/gv0
启动volume
gluster volume start gv0
12.在client上测试GlusterFS卷信息
若测试机子未安装client,按以上1-5步和7-8的步骤执行,只需要将安装命令改为yum -y install glusterfs glusterfs-client
在client上测试GlusterFS卷信息,挂载gv0
mount -t glusterfs of.glfs103:/gv0 /mnt 或 mount -t glusterfs 172.16.100.103:/gv0 /mnt
在client上增加/etc/hosts gluster机子的hostname就可以解决mount时主机名找不到的问题
查看挂载点
ls -lA /mnt | wc -l
测试完成后,删除测试用的挂载点
umount -t glusterfs 172.16.100.103:/gv0 /mnt
增加eth0(生效的网卡,可能是0)DNS
vi /etc/sysconfig/network-scripts/ifcfg-eth0增加
DNS1=221.11.1.67
DNS2=8.8.8.8
2.设置所有关联的rpm包都下载到本地(必需要做,否则后续步骤yum安装会失败)
vi /etc/yum.conf
修改keepcache=1
3.联网后,安装以下软件
yum install openssl-devel
yum -y install createrepo
4.修改yum源为本地
CentOS-Base.repo重命名为CentOS-Base.repo.bak,使其不生效
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
增加本地yum源的配置,在/etc/yum.repos.d/目录下,新建glfs.repo文件(文件名以.repo结尾即可)
vi /etc/yum.repos.d/glfs.repo 增加以下内容
[glfs]
name=glfs
baseurl=file:///home/rpms
enabled=1
gpgcheck=0
新建rmps文件夹,存放本地rpm包
mkdir /home/rpms
通过xftp上传GlusterFS的19个rpm包,上传到glfs.repo配置里的/home/rpms目录下
生成本地repo信息
cd /home/rpms
createrepo ./
5.安装glusterfs-server
yum -y install glusterfs-server
若server和client同要安装同一台机子上,执行以下命令
yum -y install glusterfs glusterfs-client glusterfs-server
6.启动glusterd服务
查看服务是否启动,未启动需要手动启动
service glusterd status
并设置开机启动 chkconfig glusterd on
7.将yum源重新改为联网,这步不是必须的
/etc/yum.repos.d/CentOS-Base.repo.bak重命名为CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo.bak /etc/yum.repos.d/CentOS-Base.repo
8.在iptables增加gluster端口,若增加规则GlusterFS Server还不能相互探测到peer,则关闭iptables服务
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 24007:24008 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 49152:49162 -j ACCEPT
重启iptables服务
service iptables restart
9.建立peer,通过hostname访问对端peer,建议配置hostname(若不配置hostname,迁移场景IP变化时,就麻烦了)
gluster peer probe ip/hostname
gluster peer probe 172.16.100.103 或 gluster peer probe of.glfs103
gluster peer probe 172.16.100.104 【hostname】of.glfs104
gluster peer probe 172.16.100.105 【hostname】of.glfs105
gluster peer probe 172.16.100.106 【hostname】of.glfs106
成功后,通过gluster peer status查看状态,保证所有的peer都是Connect状态
10.每台Server都需要创建相同目录并配置fstab
在每台Server上创建相同的目录
mkdir -p /data/brick1
在每台Server上配置fstab
vi /etc/fstab增加以下项
/dev/sdb1 /data/brick1 ext4 defaults 1 2
sdb1:GulsterFS使用存储所在的磁盘,若使用镜像卷,sdb1的空间大小基本一致
挂载并查看fstab信息
mount -a && mount
11.创建并启动镜像volume
of.glfs103和of.glfs104作为一组镜像卷
of.glfs105和of.glfs106作为一组镜像卷
gluster volume create gv0 replica 2 of.glfs103:/data/brick1/gv0 of.glfs104:/data/brick1/gv0 of.glfs105:/data/brick1/gv0 of.glfs106:/data/brick1/gv0
启动volume
gluster volume start gv0
12.在client上测试GlusterFS卷信息
若测试机子未安装client,按以上1-5步和7-8的步骤执行,只需要将安装命令改为yum -y install glusterfs glusterfs-client
在client上测试GlusterFS卷信息,挂载gv0
mount -t glusterfs of.glfs103:/gv0 /mnt 或 mount -t glusterfs 172.16.100.103:/gv0 /mnt
在client上增加/etc/hosts gluster机子的hostname就可以解决mount时主机名找不到的问题
查看挂载点
ls -lA /mnt | wc -l
测试完成后,删除测试用的挂载点
umount -t glusterfs 172.16.100.103:/gv0 /mnt
相关文章推荐
- 分布式文件系统glusterfs安装步骤
- 分布式文件系统glusterfs安装步骤
- win2003下安装破解汉化jira5步骤_史上最细节
- Storm集群安装部署步骤【详细版】
- linux下安装jdk步骤
- Php编译安装步骤
- centos7下elasticsearch安装以及elasticsearch的中文分词插件ik的安装步骤
- Apache+tomcat+mysql安装步骤
- ArcGIS9.3安装步骤
- Linux下安装和卸载jdk步骤详述
- 在 CentOs5 上 安装 asterisk 的步骤
- 制作ubuntu的u盘启动安装盘步骤详解
- 阿里云ECS(linux)一键安装web环境sh安装步骤
- linux—mysql安装步骤
- linux下应用程序安装方法介绍及步骤
- CentOS7安装Hadoop2.7完整步骤
- GemFire 入门篇2:GemFire 8.2 在CentOS & Mac OS X的安装步骤 - doubletree - 博客园
- Cygwin安装步骤
- 简单介绍Linux下安装Tomcat的步骤