- 浏览: 215390 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
weiwangchao:
好用么?好用么?
PHP的pack("H*", $str)转换为java函数 -
qianguming:
顶起
[转]MYSQL中查找重复记录的几种情况 -
wxf1988:
好用,非常好
下载中文文件名乱码问题 -
f0799:
firefox 附件下载中文乱码,确实很头疼
下载中文文件名乱码问题 -
liukun309:
很好,帮我解决了下载excel文件名乱码问题
下载中文文件名乱码问题
在服务器集群中,为了同步更新APP内容,利用Glusterfs分布式存储功达到相同的APP只更新一次,其他机器同步更新
试验环境:Vmware Fusion3.1.1 CentOS 5.5
1.安装
#yum -y install glusterfs-cluster glusterfs-server
2.设置两台机器的别名分别为svr1,svr2
3.两台机器的服务端配置文件和客户端文件如下:
服务端配置文件glusterfsd.vol
[root@svr1 ~]# cat /etc/glusterfs/glusterfsd.vol
### file: server-volume.vol.sample
#####################################
### GlusterFS Server Volume File ##
#####################################
#### CONFIG FILE RULES:
### "#" is comment character.
### - Config file is case sensitive
### - Options within a volume block can be in any order.
### - Spaces or tabs are used as delimitter within a line.
### - Multiple values to options will be : delimitted.
### - Each option should end within a line.
### - Missing or commented fields will assume default values.
### - Blank/commented lines are allowed.
### - Sub-volumes should already be defined above before referring.
### Export volume "brick" with the contents of "/home/export" directory.
volume posix
type storage/posix # POSIX FS translator
option directory /opt/export # Export this directory
end-volume
volume locks
type features/locks
# option mandatory-locks on
subvolumes posix
end-volume
volume brick
type performance/io-threads
option thread-count 8
subvolumes locks
end-volume
### Add network serving capability to above brick.
volume server
type protocol/server
option transport-type tcp
# option transport-type unix
# option transport-type ib-sdp
# option transport.socket.bind-address 192.168.1.10 # Default is to listen on all interfaces
# option transport.socket.listen-port 6996 # Default is 6996
# option transport-type ib-verbs
# option transport.ib-verbs.bind-address 192.168.1.10 # Default is to listen on all interfaces
# option transport.ib-verbs.listen-port 6996 # Default is 6996
# option transport.ib-verbs.work-request-send-size 131072
# option transport.ib-verbs.work-request-send-count 64
# option transport.ib-verbs.work-request-recv-size 131072
# option transport.ib-verbs.work-request-recv-count 64
# option client-volume-filename /etc/glusterfs/glusterfs-client.vol
subvolumes brick
# NOTE: Access to any volume through protocol/server is denied by
# default. You need to explicitly grant access through # "auth"
# option.
option auth.addr.brick.allow 127.0.0.1,192.168.* # Allow access to "brick" volume
end-volume
客户端配置文件glusterfs.vol
[root@svr1 ~]# cat /etc/glusterfs/glusterfs.vol
### file: client-volume.vol.sample
#####################################
### GlusterFS Client Volume File ##
#####################################
#### CONFIG FILE RULES:
### "#" is comment character.
### - Config file is case sensitive
### - Options within a volume block can be in any order.
### - Spaces or tabs are used as delimitter within a line.
### - Each option should end within a line.
### - Missing or commented fields will assume default values.
### - Blank/commented lines are allowed.
### - Sub-volumes should already be defined above before referring.
### Add client feature and attach to remote subvolume
volume svr1
type protocol/client
option transport-type tcp
option remote-host svr1
option remote-subvolume brick #name of the remote volume
end-volume
volume svr2
type protocol/client
option transport-type tcp
option remote-host svr2
option remote-subvolume brick
end-volume
volume replicate1
type cluster/replicate
subvolumes svr1
end-volume
volume replicate2
type cluster/replicate
subvolumes svr2
end-volume
volume distribute
type cluster/distribute
subvolumes replicate1 replicate2
# subvolumes replicate1
end-volume
volume writebehind
type performance/write-behind
option cache-size 1MB
subvolumes distribute
end-volume
volume cache
type performance/io-cache
option cache-size 64MB
subvolumes writebehind
end-volume
4.接下来启动服务端
[root@svr1 ~]# glusterfsd -f /etc/glusterfs/glusterfsd.vol
执行ps fax|grep gluseterfs查看是否有启动
使用以上命令操作svr2
5.启动客户端
启动客户端之前先挂起fuse
[root@svr1 ~]# modprobe fuse
启动客户端
[root@svr1 ~]# glusterfs -l /var/log/glusterfs/opt-glusterfs.log -f /etc/glusterfs/glusterfs.vol /opt/clusterfs
使用df -h 查看挂载是否成功
[root@svr1 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/hda2 5.7G 4.6G 858M 85% /
/dev/hda3 2.9G 69M 2.7G 3% /home
/dev/hda1 99M 12M 82M 13% /boot
tmpfs 502M 0 502M 0% /dev/shm
glusterfs#/etc/glusterfs/glusterfs.vol
12G 9.0G 1.9G 84% /opt/clusterfs
如果没有如上显示,则说明挂载没有成功,可以查看/var/log/glusterfs/opt-glusterfs.log下建立的日志进行排错
最后使用以上命令进行svr2的操作
注:假如重启到glusterfs挂连接不上,可以使用命令取消挂起
[root@svr1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_webserver2-lv_root
50G 2.0G 45G 5% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda1 485M 37M 423M 8% /boot
/dev/mapper/vg_webserver2-lv_home
46G 180M 44G 1% /home
df: `/opt/clusterfs': Transport endpoint is not connected
[root@svr1 ~]#umount /opt/clusterfs
root@svr2 ~]#umount /opt/clusterfs
================================
最后的效果是,不管在哪台机器上的/opt/glusterfs下新建更新文件,都会同步更新到另一台机器上,当你相同的APP在N台机器上时,这是多么轻松的事啊
试验环境:Vmware Fusion3.1.1 CentOS 5.5
1.安装
#yum -y install glusterfs-cluster glusterfs-server
2.设置两台机器的别名分别为svr1,svr2
3.两台机器的服务端配置文件和客户端文件如下:
服务端配置文件glusterfsd.vol
[root@svr1 ~]# cat /etc/glusterfs/glusterfsd.vol
### file: server-volume.vol.sample
#####################################
### GlusterFS Server Volume File ##
#####################################
#### CONFIG FILE RULES:
### "#" is comment character.
### - Config file is case sensitive
### - Options within a volume block can be in any order.
### - Spaces or tabs are used as delimitter within a line.
### - Multiple values to options will be : delimitted.
### - Each option should end within a line.
### - Missing or commented fields will assume default values.
### - Blank/commented lines are allowed.
### - Sub-volumes should already be defined above before referring.
### Export volume "brick" with the contents of "/home/export" directory.
volume posix
type storage/posix # POSIX FS translator
option directory /opt/export # Export this directory
end-volume
volume locks
type features/locks
# option mandatory-locks on
subvolumes posix
end-volume
volume brick
type performance/io-threads
option thread-count 8
subvolumes locks
end-volume
### Add network serving capability to above brick.
volume server
type protocol/server
option transport-type tcp
# option transport-type unix
# option transport-type ib-sdp
# option transport.socket.bind-address 192.168.1.10 # Default is to listen on all interfaces
# option transport.socket.listen-port 6996 # Default is 6996
# option transport-type ib-verbs
# option transport.ib-verbs.bind-address 192.168.1.10 # Default is to listen on all interfaces
# option transport.ib-verbs.listen-port 6996 # Default is 6996
# option transport.ib-verbs.work-request-send-size 131072
# option transport.ib-verbs.work-request-send-count 64
# option transport.ib-verbs.work-request-recv-size 131072
# option transport.ib-verbs.work-request-recv-count 64
# option client-volume-filename /etc/glusterfs/glusterfs-client.vol
subvolumes brick
# NOTE: Access to any volume through protocol/server is denied by
# default. You need to explicitly grant access through # "auth"
# option.
option auth.addr.brick.allow 127.0.0.1,192.168.* # Allow access to "brick" volume
end-volume
客户端配置文件glusterfs.vol
[root@svr1 ~]# cat /etc/glusterfs/glusterfs.vol
### file: client-volume.vol.sample
#####################################
### GlusterFS Client Volume File ##
#####################################
#### CONFIG FILE RULES:
### "#" is comment character.
### - Config file is case sensitive
### - Options within a volume block can be in any order.
### - Spaces or tabs are used as delimitter within a line.
### - Each option should end within a line.
### - Missing or commented fields will assume default values.
### - Blank/commented lines are allowed.
### - Sub-volumes should already be defined above before referring.
### Add client feature and attach to remote subvolume
volume svr1
type protocol/client
option transport-type tcp
option remote-host svr1
option remote-subvolume brick #name of the remote volume
end-volume
volume svr2
type protocol/client
option transport-type tcp
option remote-host svr2
option remote-subvolume brick
end-volume
volume replicate1
type cluster/replicate
subvolumes svr1
end-volume
volume replicate2
type cluster/replicate
subvolumes svr2
end-volume
volume distribute
type cluster/distribute
subvolumes replicate1 replicate2
# subvolumes replicate1
end-volume
volume writebehind
type performance/write-behind
option cache-size 1MB
subvolumes distribute
end-volume
volume cache
type performance/io-cache
option cache-size 64MB
subvolumes writebehind
end-volume
4.接下来启动服务端
[root@svr1 ~]# glusterfsd -f /etc/glusterfs/glusterfsd.vol
执行ps fax|grep gluseterfs查看是否有启动
使用以上命令操作svr2
5.启动客户端
启动客户端之前先挂起fuse
[root@svr1 ~]# modprobe fuse
启动客户端
[root@svr1 ~]# glusterfs -l /var/log/glusterfs/opt-glusterfs.log -f /etc/glusterfs/glusterfs.vol /opt/clusterfs
使用df -h 查看挂载是否成功
[root@svr1 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/hda2 5.7G 4.6G 858M 85% /
/dev/hda3 2.9G 69M 2.7G 3% /home
/dev/hda1 99M 12M 82M 13% /boot
tmpfs 502M 0 502M 0% /dev/shm
glusterfs#/etc/glusterfs/glusterfs.vol
12G 9.0G 1.9G 84% /opt/clusterfs
如果没有如上显示,则说明挂载没有成功,可以查看/var/log/glusterfs/opt-glusterfs.log下建立的日志进行排错
最后使用以上命令进行svr2的操作
注:假如重启到glusterfs挂连接不上,可以使用命令取消挂起
[root@svr1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_webserver2-lv_root
50G 2.0G 45G 5% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda1 485M 37M 423M 8% /boot
/dev/mapper/vg_webserver2-lv_home
46G 180M 44G 1% /home
df: `/opt/clusterfs': Transport endpoint is not connected
[root@svr1 ~]#umount /opt/clusterfs
root@svr2 ~]#umount /opt/clusterfs
================================
最后的效果是,不管在哪台机器上的/opt/glusterfs下新建更新文件,都会同步更新到另一台机器上,当你相同的APP在N台机器上时,这是多么轻松的事啊
发表评论
-
CentOS 6.5系统中iptables防火墙开放端口
2019-03-12 10:37 997开放端口80,22,3306,8080命令 /sbin/i ... -
Centos释放缓存
2013-01-28 17:50 1014用centos的会发现,有时候系统处于空闲状态,但是内存全部被 ... -
DenyHosts阻止SSH暴力破解最好的方法
2013-01-17 18:03 996当你的linux服务器暴露在互联网之中,该服务器将会遭到互联网 ... -
给centos 6.2安装yum源
2012-09-11 23:03 1911CentOS自带的yum源不够丰富,为了使用方便,我经常借用第 ... -
linux开机启动服务的修改与查看
2011-04-08 16:28 3286每次系统开机的时候,都会根据不同的runlevel级别启动不同 ... -
HAProxy的安装和部署
2011-04-07 16:58 4701原文出处:http://blog.ehomy.net/arch ... -
用CRM命令行工具配置集群资源
2011-03-31 11:44 1565以下为转帖,原帖网址为 ... -
error while loading shared libraries
2011-03-24 15:30 1335启动服务时出现 error while loading sha ... -
修改linux时间
2010-11-03 11:52 1322date 显示当前时间 Fri Aug 3 14:15:1 ... -
在LINUX中关于后台执行运行命令
2010-11-03 11:44 1553在Linux中,如果要让进 ... -
linux 主机间复制文件 scp 命令
2010-05-25 17:11 1809================== scp 命令 === ... -
linux下查看CPU、内存、硬盘方法
2009-01-02 20:37 4595一、CPU大小 [root@idc ~]# cat /proc ... -
wget的下载与安装
2008-07-06 02:02 5139wget的下载与安装: 下载地址:ftp://ftp.cs.c ... -
mysql-standard-5.0.27-linux-i686的安装
2008-06-13 15:36 2558mysql-standard-5.0.27-linux-i68 ... -
Linux下jdk1.6的安装
2008-06-13 14:15 20851 首先,从sun下载jdk1.6的安装文件,一般有两种。 下 ... -
安装FMS时出现Your distribution, unknown, is not support
2008-02-15 16:53 1452./installFMS ERROR: Your distri ... -
LINUX调整时差
2008-01-08 11:56 1314在/etc/profile加入設定時區的指令,這樣重開後還可以 ... -
LINUX解压汇总
2008-01-08 11:54 7616大致总结了一下linux下各种格式的压缩包的压缩、解压方法。但 ... -
linux开机启动tomcat
2008-01-08 11:52 3035Start Tomcat and Apache at Boot ... -
命令集
2008-01-08 11:51 1077chkconfig 命令激活和停运服务 关键词: linux ...
相关推荐
GlusterFS分布式文件系统群集资源.rar
Linux运维-运维课程MP4存储专题-d2-glusterfs分布式存储-11-glusterfs小结.mp4
GlusterFS分布式文件系统架构介绍,EHA算法介绍,5中分布式卷的详细介绍,性能测试对比
Linux运维-运维课程MP4存储专题-d2-glusterfs分布式存储-01-glusterfs集群环境再确认.mp4
Linux运维-运维课程MP4存储专题-d2-glusterfs分布式存储-12-ceph引入.mp4
GlusterFS分布式文件系统的安装配置教程.docx
Linux运维-运维课程MP4存储专题-d2-glusterfs分布式存储-14-ceph集群环境说明.mp4
Linux运维-运维课程MP4存储专题-d2-glusterfs分布式存储-15-ceph集群环境准备过程演
Linux运维-运维课程MP4存储专题-d2-glusterfs分布式存储-06-stripe卷创建-连接与测试.mp4
GlusterFS概述,GlusterFS设计目标 GlusterFS的设计思想显著区别有现有并行/集群/分布式文件系统;GlusterFS技术特点,GlusterFS总体架构与设计;GlusterFS相关算法和流程介绍
centos7 Glusterds分布式存储安装配置以及其已经常用维护命
#资源达人分享计划#
TStore 是基于 GlusterFS 开发的分布式存储系统
技术文档分享。
GlusterFS的分布式冗余存储 到挺的一片论文!
GlusterFS最初的目标是代替Lustre和GPFS分布式文件系统,经过八年左右的蓬勃发展,GlusterFS目前在开源社区活跃度非常之高,这个后起之秀已经俨然与Lustre、MooseFS、CEPH并列成为四大开源分布式文件系统。...
• ⽆无中⼼心的存储设计: glusterfs • 有中⼼心的存储设计:hadoop • 基于数据库的存储设计: gridfs, hbase • 绕过问题的存储设计: fastdfs
Alluxio(以前称为Tachyon)是一个虚拟的分布式存储系统。它弥合了计算框架和存储系统之间的鸿沟,使计算应用程序可以通过公共接口连接到众多存储系统。Alluxio项目源自加州大学伯克利分校AMPLab的一个名为Tachyon的...