隨筆-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
          # 存儲主機加入信任存儲池
          gluster peer probe fs-server-2
          gluster peer probe fs-server-3
          # 查看狀態(tài)
          gluster peer status
          # 五中類型的volume可以被創(chuàng)建:
              Distributed:分布式卷,文件通過hash算法隨機的分布到由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
          注意:當你給分布式復(fù)制卷和分布式條帶卷中增加bricks時,你增加的bricks的數(shù)目必須是復(fù)制或者條帶數(shù)目的倍數(shù),例如:你給一個分布式復(fù)制卷的replica為2,你在增加bricks的時候數(shù)量必須為2、4、6、8等。
                當移除分布式復(fù)制卷或者分布式條帶卷的時候,移除的bricks數(shù)目必須是replica或者stripe的倍數(shù)。例如:一個分布式條帶卷的stripe是2,當你移除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
          主站蜘蛛池模板: 娱乐| 乐清市| 团风县| 西贡区| 措勤县| 桂阳县| 富平县| 曲阳县| 道真| 邵阳县| 格尔木市| 通河县| 丹巴县| 万宁市| 南雄市| 周宁县| 石城县| 金坛市| 木里| 乡城县| 安乡县| 乌拉特前旗| 大丰市| 靖西县| 抚顺县| 岗巴县| 江源县| 河北区| 隆安县| 中阳县| 湘潭县| 综艺| 福建省| 南川市| 冀州市| 同江市| 奉新县| 新晃| 安新县| 右玉县| 利辛县|