Distributed File System on Amazon Linux — GlusterFS
发表时间:2015-05-13 09:35:07[Introduction]
This article provides a quick started guide on how to set up and configure GlusterFS on Amazon Linux. Two EC2 instance are being launched to accomplish this goal. On both EC2 instances, there is an instance-store volume serving as the shared storage.
Edit /etc/hosts on both EC2 instances with the following entries (assuming that the private IP addresses are 172.31.0.11 and 172.31.0.12).
172.31.4.11 gluster01
172.31.4.12 gluster02
Create the a repository definition /etc/yum.repos.d/gluster-epel.repo with the following content:
# Place this file in your /etc/yum.repos.d/ directory
[glusterfs-epel]
name=GlusterFS is a clustered file-system capable of scaling to several petabytes.
baseurl=http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-6/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0
[glusterfs-noarch-epel]
name=GlusterFS is a clustered file-system capable of scaling to several petabytes.
baseurl=http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-6/noarch
enabled=1
skip_if_unavailable=1
gpgcheck=0
[glusterfs-source-epel]
name=GlusterFS is a clustered file-system capable of scaling to several petabytes. - Source
baseurl=http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-6/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0
Use the following commands to install the necessary packages and start services.
sudo yum update
sudo yum install fuse fuse-libs nfs-utils
sudo yum install glusterfs glusterfs-fuse glusterfs-geo-replication glusterfs-server
sudo chkconfig glusterd on
sudo chkconfig glusterfsd on
sudo chkconfig rpcbind on
sudo service glusterd start
sudo service rpcbind start
[Configurations]
On both EC2 instances, create file system on the instance-store volume and mount it to /glusterfs.
sudo mkdir /glusterfs
sudo mkfs.ext4 /dev/xvdb
sudo mount /dev/xvdb /glusterfs
sudo mkdir -p /glusterfs/brick
On gluster01, probe the other EC2 instance and create the GlusterFS volume. The name of the volume is "test-volume".
sudo gluster peer probe gluster02
sudo gluster volume create test-volume replica 2 transport tcp gluster01:/glusterfs/brick gluster02:/glusterfs/brick
sudo gluster volume start test-volume
On both EC2 instance, mount the GlusterFS volume. The name of the volume is "test-volume". Then we change the ownership of the /mnt/glusterfs folder to "ec2-user:ec2-user" so that the default "ec2-user" can use the shared folder directly.
sudo mkdir -p /mnt/glusterfs
sudo mount -t glusterfs gluster01:test-volume /mnt/glusterfs
cd /mnt
sudo chown -R ec2-user:ec2-user glustefs
mount
df -h
Now the shared file system has been set up, and you can create a text file under /mnt/glusterfs and observe that the file created appears on both EC2 instances. Please bear in mind that this is only a quick start guide, and you should not use this configuration directly in a production system without further tunings.
| 上一篇 | 下一篇 |
| 姓名: | |
| 评论: | |
|
请输入下面这首诗词的作者姓名。 明月几时有,把酒问青天。 |
|
| 答案: | |
云与清风常拥有,
冰雪知音世难求。
击节纵歌相对笑,
案上诗书杯中酒。
2020年12月31日
洛杉矶
最新评论
2025-11-15 06:29:51
qyjohn 评论了 《青桔》
2025-11-14 01:55:04
wells 评论了 《青桔》
2025-10-24 18:04:06
Ted Wang 评论了 《关于作者(About Me)》
2025-03-27 08:28:09
Max 评论了 《父亲走了》
2025-03-08 04:13:52
W 评论了 《我不想颂扬普京大帝》
2024-07-22 16:02:03
云思 评论了 《无题》
2024-06-27 10:01:54
yiming 评论了 《致访客(Welcome)》
2024-05-06 08:50:06
qyjohn 评论了 《致访客(Welcome)》
2024-05-03 19:49:00
jimmie 评论了 《致访客(Welcome)》
2024-02-19 03:32:57
林小静 评论了 《埋剑渡》
2024-01-05 03:54:28
路过者 评论了 《2023年度盘点》
2024-01-04 10:22:05
qyjohn 评论了 《致访客(Welcome)》
2024-01-04 08:05:13
qyjohn 评论了 《2023年度盘点》
2023-12-17 15:18:45
qyjohn 评论了 《乱记》
2023-12-15 00:43:24
wells 评论了 《乱记》