隨筆-86  評論-33  文章-0  trackbacks-0
          ###  Installing Gluster
          wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
          yum install glusterfs{-fuse,-server}

          # 查看gluster版本信息
          glusterfs -V
          # 啟動停止服務(wù)
          service glusterd start
          service glusterd stop
          # 存儲主機(jī)加入信任存儲池
          gluster peer probe fs-server-2
          gluster peer probe fs-server-3
          # 查看狀態(tài)
          gluster peer status
          # 五中類型的volume可以被創(chuàng)建:
              Distributed:分布式卷,文件通過hash算法隨機(jī)的分布到由bricks組成的卷上。
              Replicated:復(fù)制式卷,類似raid1,replica數(shù)必須等于volume中brick所包含的存儲服務(wù)器數(shù),可用性高。
              Striped:條帶式卷,類似與raid0,stripe數(shù)必須等于volume中brick所包含的存儲服務(wù)器數(shù),文件被分成數(shù)據(jù)塊,以Round Robin的方式存儲在bricks中,并發(fā)粒度是數(shù)據(jù)塊,大文件性能好。
              Distributed Striped:分布式的條帶卷,volume中brick所包含的存儲服務(wù)器數(shù)必須是stripe的倍數(shù)(>=2倍),兼顧分布式和條帶式的功能。
              Distributed Replicated:分布式的復(fù)制卷,volume中brick所包含的存儲服務(wù)器數(shù)必須是 replica 的倍數(shù)(>=2倍),兼顧分布式和復(fù)制式的功能。
          # 創(chuàng)建分布卷
          gluster volume create gv0 fs-server-1:/data/gfs fs-server-2:/data/gfs
          # 創(chuàng)建復(fù)制卷
          gluster volume create gv0 replica 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
          # 創(chuàng)建條帶卷
          gluster volume create gv0 stripe 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
          # 啟動卷
          gluster volume start gv0
          # 查看卷
          gluster volume info gv0
          #如果以后要添加服務(wù)器,可以使用add-brick命令:
          gluster volume add-brick gv0 fs-server-3:/data/gfs fs-server-4:/data/gfs
          gluster volume remove-brick VOLNAME BRICK
          注意:當(dāng)你給分布式復(fù)制卷和分布式條帶卷中增加bricks時,你增加的bricks的數(shù)目必須是復(fù)制或者條帶數(shù)目的倍數(shù),例如:你給一個分布式復(fù)制卷的replica為2,你在增加bricks的時候數(shù)量必須為2、4、6、8等。
                當(dāng)移除分布式復(fù)制卷或者分布式條帶卷的時候,移除的bricks數(shù)目必須是replica或者stripe的倍數(shù)。例如:一個分布式條帶卷的stripe是2,當(dāng)你移除bricks的時候必須是2、4、6、8等。
          #掛載glusterfs
          mount -t glusterfs fs-server-1:/gv0 /mnt/gfs
          mount -t nfs fs-server-1:/gv0 /mnt/gfs
          mount -v -t nfs -o mountproto=tcp,vers=3 fs-server-1:/gv0 /mnt/gfs-nfs
          posted on 2013-08-09 16:00 Derek.Guo 閱讀(1517) 評論(0)  編輯  收藏 所屬分類: Linux/Unix
          MSN:envoydada@hotmail.com QQ:34935442
          主站蜘蛛池模板: 和顺县| 天津市| 镇宁| 鹤庆县| 前郭尔| 阳东县| 郯城县| 涿鹿县| 绵竹市| 墨江| 陆河县| 方城县| 增城市| 华池县| 斗六市| 图们市| 金乡县| 繁峙县| 东山县| 兴化市| 涟水县| 阿拉善左旗| 醴陵市| 武陟县| 遂川县| 南京市| 多伦县| 莫力| 南溪县| 金寨县| 新巴尔虎右旗| 寿宁县| 荔波县| 杭州市| 柘城县| 沧源| 茂名市| 双江| 舒兰市| 温州市| 海伦市|