8767564323 发表于 2016-12-20 08:50:34

centos6.5 rpm安装glusterfs以及第三方测试工具

这篇文章适合初学者读,做下实验来之后对glusterfs有一个初步的了解,我的所有操作都是在一台机器上做的。还有一些环境配置我列举了一下,并没有很详细的列出来,相信大家应该没问题。一些第三方测试工具需要大家自行在网上下载。楼主也是一个一个下载下来的.此次下载的是3.47的版本,因为我们公司用的就是这个版本,之前试过其它版本,老是会出现服务挂起的现象,没有办法,版本回退
glusterfsrpm包下载地址:
https://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.7/CentOS/epel-6.5/x86_64/
给大家这篇文章的一个概览,如下
环境配置
1. rpm包安装glusterfs以及第三方工具
1:配置本地yum源
1)创建存放rpm包的目录
2)将下载的包上传到对应的服务器目录中
3)安装createrepo工具并创建repo
4) 编辑.repo文件
5) 查看配置情况
6)网络yum源配置(了解)
2:yum安装glusterfs
1)安装
2)启动
3:yum安装第三方工具
1)安装atop fio iozone iperf sysstat
2)安装postmark
4:创建一个volume玩玩
1)创建一个testvol
2)查看testvol启动前信息
3)查看testvol启动后信息
4)挂载testvol并查看挂载情况
5) 测试挂载能否正常使用
6)卸载rpm安装的glusterfs
环境配置初始环境配置就不再赘述,相信大家都已经很熟练了吧
1:修改主机名
2:关闭selinux
3:设置时间同步
4:设置hosts文件
1.rpm包安装glusterfs以及第三方工具1:配置本地yum源 1)创建存放rpm包的目录# mkdir -p /soft/glusterf{s,stools}2)将下载的包上传到对应的服务器目录中# pwd/soft/glusterfs# lsglusterfs-3.4.7-1.el6.x86_64.rpmglusterfs-api-3.4.7-1.el6.x86_64.rpmglusterfs-api-devel-3.4.7-1.el6.x86_64.rpmglusterfs-cli-3.4.7-1.el6.x86_64.rpm glusterfs-debuginfo-3.4.7-1.el6.x86_64.rpmglusterfs-devel-3.4.7-1.el6.x86_64.rpmglusterfs-fuse-3.4.7-1.el6.x86_64.rpmglusterfs-geo-replication-3.4.7-1.el6.x86_64.rpmglusterfs-libs-3.4.7-1.el6.x86_64.rpmglusterfs-rdma-3.4.7-1.el6.x86_64.rpmglusterfs-server-3.4.7-1.el6.x86_64.rpm# pwd/soft/glusterfstools# lsatop-1.27-3.x86_64.rpm            iperf-2.0.4-1.el6.rf.x86_64.rpmfio-2.1.7-1.el6.rf.x86_64.rpm   postmark_1.51.orig.tar.gziozone-3.394-1.el6.rf.x86_64.rpm3)安装createrepo工具并创建repo# yum -y install createrepo# createrepo /soft/glusterfsSpawning worker 0 with 11 pkgsWorkers FinishedGathering worker results
Saving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite DBs complete# createrepo /soft/glusterfstools/Spawning worker 0 with 4 pkgsWorkers FinishedGathering worker results
Saving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite DBs complete4)编辑.repo文件# vim /etc/yum.repos.d/glusterfs.reponame=glusterfs rpmbaseurl=file:///soft/glusterfs/enabled=1gpgcheck=0# vim /etc/yum.repos.d/glusterfstools.reponame=glusterfs test toolsbaseurl=file:///soft/glusterfstools/enabled=1gpgcheck=05)查看配置情况# yum clean allLoaded plugins: fastestmirror, refresh-packagekit, securityCleaning repos: base extras glusterfs glusterfstools updatesCleaning up EverythingCleaning up list of fastest mirrors# yum repolistLoaded plugins: fastestmirror, refresh-packagekit, securityDetermining fastest mirrors * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirrors.tuna.tsinghua.edu.cnbase                                                   | 3.7 kB   00:00   base/primary_db                                          | 4.7 MB   00:00   extras                                                   | 3.4 kB   00:00   extras/primary_db                                        |37 kB   00:00   glusterfs                                                | 2.9 kB   00:00 ... glusterfs/primary_db                                     | 8.6 kB   00:00 ... glusterfstools                                           | 2.9 kB   00:00 ... glusterfstools/primary_db                              | 5.4 kB   00:00 ... updates                                                | 3.4 kB   00:00   updates/primary_db                                       | 3.7 MB   00:00   repo id                           repo name                               statusbase                              CentOS-6 - Base                         6,696extras                            CentOS-6 - Extras                        62glusterfs                         glusterfs rpm                              11glusterfstools                  glusterfs test tools                        4updates                           CentOS-6 - Updates                        686repolist: 7,4596)网络yum源配置(了解)# cat /etc/yum.repos.d/gluster.repo name=glusterfsbaseurl=http://download.gluster.org/pub/gluster/glusterfs/3.4/3.4.7/CentOS/epel-6.5/x86_64/enabled=1gpgcheck=0# yum clean all# yum repolistrepo id                            repo name                                    statusbase                               CentOS-6 - Base                              6,696extras                           CentOS-6 - Extras                               62glusterfs                        glusterfs                                       11updates                            CentOS-6 - Updates                           686repolist: 7,4552:yum安装glusterfs1)安装# pwd/soft/glusterfs# yum -y install glusterfs-*Loaded plugins: fastestmirror, refresh-packagekit, securityBad id for repo: root@gluster-node1 ~, byte = @ 4Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.tuna.tsinghua.edu.cnSetting up Install ProcessExamining glusterfs-3.4.7-1.el6.x86_64.rpm: glusterfs-3.4.7-1.el6.x86_64Marking glusterfs-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-api-3.4.7-1.el6.x86_64.rpm: glusterfs-api-3.4.7-1.el6.x86_64Marking glusterfs-api-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-api-devel-3.4.7-1.el6.x86_64.rpm: glusterfs-api-devel-3.4.7-1.el6.x86_64Marking glusterfs-api-devel-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-cli-3.4.7-1.el6.x86_64.rpm: glusterfs-cli-3.4.7-1.el6.x86_64Marking glusterfs-cli-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-debuginfo-3.4.7-1.el6.x86_64.rpm: glusterfs-debuginfo-3.4.7-1.el6.x86_64Marking glusterfs-debuginfo-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-devel-3.4.7-1.el6.x86_64.rpm: glusterfs-devel-3.4.7-1.el6.x86_64Marking glusterfs-devel-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-fuse-3.4.7-1.el6.x86_64.rpm: glusterfs-fuse-3.4.7-1.el6.x86_64Marking glusterfs-fuse-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-geo-replication-3.4.7-1.el6.x86_64.rpm: glusterfs-geo-replication-3.4.7-1.el6.x86_64Marking glusterfs-geo-replication-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-libs-3.4.7-1.el6.x86_64.rpm: glusterfs-libs-3.4.7-1.el6.x86_64Marking glusterfs-libs-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-rdma-3.4.7-1.el6.x86_64.rpm: glusterfs-rdma-3.4.7-1.el6.x86_64Marking glusterfs-rdma-3.4.7-1.el6.x86_64.rpm to be installedExamining glusterfs-server-3.4.7-1.el6.x86_64.rpm: glusterfs-server-3.4.7-1.el6.x86_64Marking glusterfs-server-3.4.7-1.el6.x86_64.rpm to be installedResolving Dependencies--> Running transaction check---> Package glusterfs.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-api.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-api-devel.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-cli.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-debuginfo.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-devel.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-fuse.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-geo-replication.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-libs.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-rdma.x86_64 0:3.4.7-1.el6 will be installed---> Package glusterfs-server.x86_64 0:3.4.7-1.el6 will be installed--> Processing Dependency: xfsprogs for package: glusterfs-server-3.4.7-1.el6.x86_64--> Running transaction check---> Package xfsprogs.x86_64 0:3.1.1-19.el6 will be installed--> Finished Dependency Resolution
Dependencies Resolved
================================================================================== Package         Arch   Version   Repository                               Size==================================================================================Installing: glusterfs       x86_64 3.4.7-1.el6 /glusterfs-3.4.7-1.el6.x86_64         3.6 M glusterfs-api   x86_64 3.4.7-1.el6 /glusterfs-api-3.4.7-1.el6.x86_64       126 k glusterfs-api-devel               x86_64 3.4.7-1.el6 /glusterfs-api-devel-3.4.7-1.el6.x86_6420 k glusterfs-cli   x86_64 3.4.7-1.el6 /glusterfs-cli-3.4.7-1.el6.x86_64       245 k glusterfs-debuginfo               x86_64 3.4.7-1.el6 /glusterfs-debuginfo-3.4.7-1.el6.x86_6427 M glusterfs-devel x86_64 3.4.7-1.el6 /glusterfs-devel-3.4.7-1.el6.x86_64   450 k glusterfs-fusex86_64 3.4.7-1.el6 /glusterfs-fuse-3.4.7-1.el6.x86_64      205 k glusterfs-geo-replication               x86_64 3.4.7-1.el6 /glusterfs-geo-replication-3.4.7-1.el6.x86_64                                                                            472 k glusterfs-libsx86_64 3.4.7-1.el6 /glusterfs-libs-3.4.7-1.el6.x86_64      669 k glusterfs-rdmax86_64 3.4.7-1.el6 /glusterfs-rdma-3.4.7-1.el6.x86_64       81 k glusterfs-server               x86_64 3.4.7-1.el6 /glusterfs-server-3.4.7-1.el6.x86_64    1.5 MInstalling for dependencies: xfsprogs      x86_64 3.1.1-19.el6                                    base                                    725 k
Transaction Summary==================================================================================Install      12 Package(s)
Total size: 35 MTotal download size: 725 kInstalled size: 37 MDownloading Packages:xfsprogs-3.1.1-19.el6.x86_64.rpm                           | 725 kB   00:00   Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionInstalling : glusterfs-libs-3.4.7-1.el6.x86_64                           1/12 Installing : glusterfs-3.4.7-1.el6.x86_64                                  2/12 Installing : glusterfs-fuse-3.4.7-1.el6.x86_64                           3/12 Installing : glusterfs-devel-3.4.7-1.el6.x86_64                            4/12 Installing : glusterfs-api-3.4.7-1.el6.x86_64                              5/12 Installing : glusterfs-cli-3.4.7-1.el6.x86_64                              6/12 Installing : xfsprogs-3.1.1-19.el6.x86_64                                  7/12 Installing : glusterfs-server-3.4.7-1.el6.x86_64                           8/12 Installing : glusterfs-geo-replication-3.4.7-1.el6.x86_64                  9/12 Installing : glusterfs-api-devel-3.4.7-1.el6.x86_64                     10/12 Installing : glusterfs-rdma-3.4.7-1.el6.x86_64                            11/12 Installing : glusterfs-debuginfo-3.4.7-1.el6.x86_64                     12/12 Verifying: glusterfs-fuse-3.4.7-1.el6.x86_64                           1/12 Verifying: glusterfs-3.4.7-1.el6.x86_64                                  2/12 Verifying: glusterfs-server-3.4.7-1.el6.x86_64                           3/12 Verifying: glusterfs-libs-3.4.7-1.el6.x86_64                           4/12 Verifying: glusterfs-devel-3.4.7-1.el6.x86_64                            5/12 Verifying: glusterfs-rdma-3.4.7-1.el6.x86_64                           6/12 Verifying: glusterfs-geo-replication-3.4.7-1.el6.x86_64                  7/12 Verifying: glusterfs-debuginfo-3.4.7-1.el6.x86_64                        8/12 Verifying: glusterfs-api-devel-3.4.7-1.el6.x86_64                        9/12 Verifying: glusterfs-api-3.4.7-1.el6.x86_64                           10/12 Verifying: xfsprogs-3.1.1-19.el6.x86_64                                 11/12 Verifying: glusterfs-cli-3.4.7-1.el6.x86_64                           12/12
Installed:glusterfs.x86_64 0:3.4.7-1.el6                                                glusterfs-api.x86_64 0:3.4.7-1.el6                                              glusterfs-api-devel.x86_64 0:3.4.7-1.el6                                        glusterfs-cli.x86_64 0:3.4.7-1.el6                                              glusterfs-debuginfo.x86_64 0:3.4.7-1.el6                                        glusterfs-devel.x86_64 0:3.4.7-1.el6                                          glusterfs-fuse.x86_64 0:3.4.7-1.el6                                             glusterfs-geo-replication.x86_64 0:3.4.7-1.el6                                  glusterfs-libs.x86_64 0:3.4.7-1.el6                                             glusterfs-rdma.x86_64 0:3.4.7-1.el6                                             glusterfs-server.x86_64 0:3.4.7-1.el6                                          
Dependency Installed:xfsprogs.x86_64 0:3.1.1-19.el6                                                
Complete!2)启动# service glusterd startStarting glusterd:                                       [确定]3:yum安装第三方工具1)安装atop fio iozone iperf sysstat# yum -y install atop fio iozone iperf sysstat2)安装postmarkpostmark在网上找不到rpm包,下载了个c文件
# pwd/soft/glusterfstools# tar -zxf postmark_1.51.orig.tar.gz # cd postmark-1.51/# lspostmark-1.51.c# gcc postmark-1.51.c -o /usr/bin/postmark/tmp/ccU1fr6U.o: In function `cli_show':postmark-1.51.c:(.text+0x26f9): warning: the `getwd' function is dangerous and should not be used.4:创建一个volume玩玩这个测试是找一台单机服务器作为测试,所有的操作都是在这台服务器上进行
1)创建一个testvol# gluster volume create testvol 192.168.11.139:/data/brick5 forcevolume create: testvol: success: please start the volume to access data2)查看testvol启动前信息# gluster volume statusVolume testvol is not started# gluster volume infoVolume Name: testvolType: DistributeVolume ID: dd9da9ff-026e-4c1a-a0a1-720a7df2b7f3Status: CreatedNumber of Bricks: 1Transport-type: tcpBricks:Brick1: 192.168.11.139:/data/brick53)查看testvol启动后信息# gluster volume start testvolvolume start: testvol: success# gluster volume infoVolume Name: testvolType: DistributeVolume ID: dd9da9ff-026e-4c1a-a0a1-720a7df2b7f3Status: StartedNumber of Bricks: 1Transport-type: tcpBricks:Brick1: 192.168.11.139:/data/brick54)挂载testvol并查看挂载情况# mount -t glusterfs 192.168.11.139:/testvol /mnt# df -hFilesystem                  SizeUsed Avail Use% Mounted on/dev/mapper/VolGroup-lv_root   18G3.8G   14G23% /tmpfs                         364M228K364M   1% /dev/shm/dev/sda1                     485M   35M426M   8% /boot192.168.11.139:/testvol      18G3.8G   14G23% /mnt5)测试挂载能否正常使用# cd /mnt/# ls# touch a# vim a# cat a this is a demohello world# df -hFilesystem                  SizeUsed Avail Use% Mounted on/dev/mapper/VolGroup-lv_root   18G3.8G   14G23% /tmpfs                         364M228K364M   1% /dev/shm/dev/sda1                     485M   35M426M   8% /boot192.168.11.139:/testvol      18G3.8G   14G23% /mnt#cd /data/brick5/# lsa# cat a this is a demohello world6)卸载rpm安装的glusterfs# service glusterd stop# rpm -qa | grep glusterfs      [确定]glusterfs-api-3.4.7-1.el6.x86_64glusterfs-geo-replication-3.4.7-1.el6.x86_64glusterfs-3.4.7-1.el6.x86_64glusterfs-fuse-3.4.7-1.el6.x86_64glusterfs-debuginfo-3.4.7-1.el6.x86_64glusterfs-devel-3.4.7-1.el6.x86_64glusterfs-server-3.4.7-1.el6.x86_64glusterfs-rdma-3.4.7-1.el6.x86_64glusterfs-libs-3.4.7-1.el6.x86_64glusterfs-cli-3.4.7-1.el6.x86_64glusterfs-api-devel-3.4.7-1.el6.x86_64# rpm -qa | grep glusterfs | xargs rpm -e# rpm -qa |grep glusterfs
页: [1]
查看完整版本: centos6.5 rpm安装glusterfs以及第三方测试工具