国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網管 > 服務器 > 正文

GlusterFS分布式文件系統的安裝配置教程

2020-05-27 13:09:38
字體:
來源:轉載
供稿:網友

  GlusterFS主要應用在集群系統中,具有很好的可擴展性。軟件的結構設計良好,易于擴展和配置,通過各個模塊的靈活搭配以得到針對性的解決方案。可解決以下問題:網絡存儲,聯合存儲(融合多個節點上的存儲空間),冗余備份,大文件的負載均衡(分塊)。

  由于缺乏一些關鍵特性,可靠性也未經過長時間考驗,還不適合應用于需要提供 24 小時不間斷服務的產品環境。目前適合應用于大數據量的離線應用,下面一起來看GlusterFS分布式文件系統的安裝配置

  GlusterFS是一個開源的分布式文件系統,用戶可以使用多臺服務器,并通過以太網或者Infiniband RDMA互聯從而組成一個GlusterFS的集群

  。

  GlusterFS集群對外提供NFS,CIFS和Gluster Native(通過FUSE進行掛載)的接口以便用戶訪問GlusterFS的存儲池。

  GlusterFS使用了彈性哈希算法來定位文件存儲的位置。 由于使用了彈性哈希算法,GlusterFS不需要專門的Meta-Data Server來保存元數據,因此可以避免因為元數據服務器宕機導致的整個集群不可用。

  也正是因為不需要元數據服務器,所以GlusterFS在多個掛載點同時進行數據讀寫的時候,其整體性能很突出。

  fuse-2.9.3.tar.gz #依賴于fuse

  glusterfs-3.6.0.tar.gz #本文用的版本

  準備2臺機器,系統為centos6.5 64位。

  IP地址 主機名

  192.168.0.107 g1

  192.168.0.136 g2

  首先關閉iptables和selinux。

  修改主機名,并添加hosts映射:

  g1:

  [root@localhost ~]# cat /etc/sysconfig/network

  NETWORKING=yes

  HOSTNAME=g1

  [root@localhost ~]# hostname

  g1

  [root@localhost ~]# cat /etc/hosts

  127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

  ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

  192.168.0.107 g1

  192.168.0.136 g2

  g2:

  [root@localhost ~]# cat /etc/sysconfig/network

  NETWORKING=yes

  HOSTNAME=g2

  [root@localhost ~]# hostname

  g2

  [root@localhost ~]# cat /etc/hosts

  127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

  ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

  192.168.0.107 g1

  192.168.0.136 g2

  安裝預編譯環境:

  [root@localhost ~]# yum install -y gcc gcc-c++ flex flex-devel bison bison-devel openssl openssl-devel libxml2 libxml2-devel

  安裝fuse:

  [root@localhost ~]# cd fuse-2.9.3

  [root@localhost fuse-2.9.3]# ./configure && make && make install

  [root@localhost fuse-2.9.3]# cd

  安裝gluster:

  [root@localhost ~]# cd glusterfs-3.6.0

  [root@localhost glusterfs-3.6.0]# ./configure --prefix=/usr/local/glusterfs && make && make install

  g1和g2均執行上面操作。

  g1和g2啟動gluster:

  [root@localhost ~]# service glusterd start

  添加集群:

  [root@localhost ~]# ln -s /usr/local/glusterfs/sbin/gluster /usr/bin/gluster #做一個軟鏈接方便執行命令

  [root@localhost ~]# gluster peer probe g2 #在g1中將g2加入到gluster集群中,本機(g1)不需要加入。

  peer probe: success. Probe on localhost not needed

  查看集群信息:

  [root@localhost ~]# gluster peer status

  Number of Peers: 1

  Hostname: g2

  Uuid: c7aa664a-3161-4716-9f81-2dc4b4718fa1

  State: Peer in Cluster (Connected) #已連接

  剔除機器:

  [root@localhost ~]# gluster peer detach g2

  peer detach: success

  創建卷:

  [root@localhost ~]# gluster volume create test-volume replica 2 transport tcp g1:/data g2:/data force

  volume create: test-volume: success: please start the volume to access data

  test-volume 卷名 replica 副本數 transport 傳輸協議 g1:/data 服務器名及存儲路徑

  啟動卷:

  [root@localhost ~]# gluster volume start test-volume

  volume start: test-volume: success

  查看卷:

  [root@localhost ~]# gluster volume info

  Volume Name: test-volume

  Type: Replicate

  Volume ID: 104d73c5-17f5-4150-a40d-b97cd78dd6bb

  Status: Started

  Number of Bricks: 1 x 2 = 2

  Transport-type: tcp

  Bricks:

  Brick1: g1:/data

  Brick2: g2:/data

  客戶端1掛載(同樣安裝fuse和glusterfs才能支持glusterfs文件系統):

  [root@localhost ~]# mkdir /mnt/gfs

  [root@localhost ~]# mount -t glusterfs g1:test-volume /mnt/gfs/

  [root@localhost ~]# df -h

  Filesystem Size Used Avail Use% Mounted on

  /dev/sda1 77G 3.7G 70G 6% /

  tmpfs 499M 0 499M 0% /dev/shm

  g1:test-volume 77G 3.8G 70G 6% /mnt/gfs

  客戶端2掛載:

  [root@localhost ~]# mkdir /mnt/gfs

  [root@localhost ~]# mount -t glusterfs g2:test-volume /mnt/gfs

  [root@localhost ~]# df -h

  Filesystem Size Used Avail Use% Mounted on

  /dev/sda1 77G 3.8G 70G 6% /

  tmpfs 499M 0 499M 0% /dev/shm

  g2:test-volume 77G 3.8G 70G 6% /mnt/gfs

  可以看到g1和g2都支持掛載。

  gluster支持的參

  [root@localhost ~]# gluster help #查看參數

  安裝配置完成。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 海晏县| 山阴县| 林口县| 红桥区| 阳东县| 榆树市| 奈曼旗| 高台县| 元谋县| 吉木萨尔县| 郎溪县| 彰化市| 阿克苏市| 重庆市| 南宫市| 普陀区| 兴和县| 宾阳县| 锦屏县| 宣城市| 武威市| 安龙县| 泰州市| 阳东县| 伊宁县| 恩施市| 五华县| 太白县| 凌海市| 宁阳县| 星子县| 乳山市| 德兴市| 红安县| 郴州市| 博客| 桂林市| 黑山县| 寻乌县| 阿克陶县| 定襄县|