Glusterfs 文件系统
Glusterfs
我的系列文档
Netkiller Architect 手札 |
Netkiller Developer 手札 |
Netkiller PHP 手札 |
Netkiller Python 手札 |
Netkiller Testing 手札 |
---|---|---|---|---|
Netkiller Cryptography 手札 |
Netkiller Linux 手札 |
Netkiller Debian 手札 |
Netkiller CentOS 手札 |
Netkiller FreeBSD 手札 |
Netkiller Shell 手札 |
Netkiller Security 手札 |
Netkiller Web 手札 |
Netkiller Monitoring 手札 |
Netkiller Storage 手札 |
Netkiller Mail 手札 |
Netkiller Docbook 手札 |
Netkiller Project 手札 |
Netkiller Database 手札 |
Netkiller PostgreSQL 手札 |
Netkiller MySQL 手札 |
Netkiller NoSQL 手札 |
Netkiller LDAP 手札 |
Netkiller Network 手札 |
Netkiller Cisco IOS 手札 |
Netkiller H3C 手札 |
Netkiller Multimedia 手札 |
Netkiller Perl 手札 |
Netkiller Amateur Radio 手札 |
Netkiller DevOps 手札 |
您可以使用iBook阅读当前文档
Table of Contents
- 1. Host
- 2. Storage bricks
- 3. Server
- 4. Check brick nodes
-
5. Client
- 5.1. /etc/fstab
- 6. Other
1. Host
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.6.12 client1.example.com client1
192.168.6.13 server.example.com server
192.168.6.1 brick1.example.com brick1
192.168.2.1 brick2.example.com brick2
2. Storage bricks
brick1, brick2
Install Gluster packages on both nodes
wget http://download.gluster.org/pub/gluster/glusterfs/3.5/3.5.2/CentOS/glusterfs-epel.repo -P /etc/yum.repos.d/
yum install -y glusterfs-server
chkconfig glusterd on
service glusterd start
service iptables stop
mkdir /opt/export
3. Server
Install Gluster packages on server nodes
wget http://download.gluster.org/pub/gluster/glusterfs/3.5/3.5.2/CentOS/glusterfs-epel.repo -P /etc/yum.repos.d/
yum install -y glusterfs-server
chkconfig glusterd on
service glusterd start
Run the gluster peer probe command
# gluster peer probe brick1.example.com
peer probe: success.
# gluster peer probe brick2.example.com
peer probe: success.
# gluster peer status
Number of Peers: 2
Hostname: brick1.example.com
Uuid: c8acab33-ed6a-4aa5-8b77-5be84695ffce
State: Peer in Cluster (Connected)
Hostname: brick2.example.com
Uuid: bf309355-7444-48e4-a7ea-25223c771160
State: Peer in Cluster (Connected)
Configure your Gluster volume
# gluster volume create testvol replica 2 transport tcp brick1.example.com:/opt/export brick2.example.com:/opt/export
volume create: testvol: success: please start the volume to access data
# gluster volume start testvol
volume start: testvol: success
# gluster volume info
Volume Name: testvol
Type: Replicate
Volume ID: cd4cdf2f-178b-4160-9ee9-c579266753de
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: brick1.example.com:/opt/export
Brick2: brick2.example.com:/opt/export
# gluster volume set testvol auth.allow client.example.com
volume set: success
# gluster volume info
Volume Name: testvol
Type: Replicate
Volume ID: cd4cdf2f-178b-4160-9ee9-c579266753de
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: brick1.example.com:/opt/export
Brick2: brick2.example.com:/opt/export
Options Reconfigured:
auth.allow: client.example.com
4. Check brick nodes
netstat -tap | grep glusterfsd
# netstat -tap | grep glusterfsd
tcp 0 0 *:49152 *:* LISTEN 13841/glusterfsd
tcp 0 0 brick1.example.com:49152 brick1.example.com:1014 ESTABLISHED 13841/glusterfsd
tcp 0 0 brick1.example.com:exp1 brick1.example.com:24007 ESTABLISHED 13841/glusterfsd
tcp 0 0 brick1.example.com:49152 brick2.example.com:1011 ESTABLISHED 13841/glusterfsd
tcp 0 0 brick1.example.com:49152 brick2.example.com:1012 ESTABLISHED 13841/glusterfsd
tcp 0 0 brick1.example.com:49152 server.example.com:1017 ESTABLISHED 13841/glusterfsd
tcp 0 0 brick1.example.com:49152 brick1.example.com:1020 ESTABLISHED 13841/glusterfsd
5. Client
Install Gluster packages on client nodes
wget http://download.gluster.org/pub/gluster/glusterfs/3.5/3.5.2/CentOS/glusterfs-epel.repo -P /etc/yum.repos.d/
yum install -y glusterfs-client
Test using the volume
mkdir /mnt/glusterfs
mount.glusterfs server.example.com:/testvol /mnt/glusterfs
Add an entry to /etc/fstab
server1.example.com:/testvol /mnt/glusterfs glusterfs defaults,_netdev 0 0
# mount
/dev/vda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
server.example.com:/testvol on /mnt/glusterfs type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 38G 2.3G 34G 7% /
tmpfs 939M 0 939M 0% /dev/shm
server.example.com:/testvol
477G 359G 101G 79% /mnt/glusterfs
# touch /mnt/glusterfs/hello
# ll /mnt/glusterfs/
total 0
-rw-r--r-- 1 root root 0 Sep 23 14:31 hello
brick1
# ll /opt/export/
total 0
-rw-r--r-- 2 root root 0 Sep 23 14:31 hello
brick2
# ll /opt/export/
total 0
-rw-r--r-- 2 root root 0 Sep 23 14:31 hello
5.1. /etc/fstab
Add an entry to /etc/fstab
server1.example.com:/testvol /mnt/glusterfs glusterfs defaults,_netdev 0 0
6. Other
stop volume
# gluster volume stop testvol
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
volume stop: testvol: success
delete volume
# gluster volume delete testvol
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
volume delete: testvol: success
# gluster peer datach brick1.example.com
# gluster volume remove-brick testvol brick1.example.com:/export/u01
- 编程语言之间的百舸争流
- Mysql连接错误:Lost connection to Mysql server at 'waiting for initial communication packet'
- 适应现代变化的数据架构
- Linux下修改系统编码的操作记录
- 微信公众平
- linq to xml复习
- web cache server方案比较:varnish、squid、nginx
- Nginx虚拟目录alias和root目录
- Nginx的https配置记录以及http强制跳转到https的方法梳理
- VPC下访问FTP的问题
- 分析车辆雨刮频次计算降雨量 大数据服务天气预报
- 干货:这里有一份小程序接入微信支付避雷指南
- Mysql占用过高CPU时的优化手段
- 服务器端加入自动运行的JS代码
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- R语言聚类算法的应用实例
- Python时间序列选择波动率预测指数收益算法分析案例
- Linux 常用系统工作命令-date
- R使用LASSO回归预测股票收益
- Linux 常用系统工作命令-reboot、poweroff、wget
- Node.js + Socket.io 实现一对一即时聊天
- Linux 常用系统工作命令-ps、top
- Python之LDA主题模型算法应用
- R语言highfrequency高频金融数据导入
- IIS配置优化
- R语言做复杂金融产品的几何布朗运动的模拟
- R语言数据的收益率和可能的波动性交易
- 哈希算法的设计要点及应用场景
- R语言通过WinBUGS对MGARCH和MSV模型进行贝叶斯估计和比较
- Spring Boot中使用 Swagger2 自动构建API文档