首页 > 其他 > 详细

Docker-registry + GlusterFS

时间:2015-12-11 07:15:44      阅读:791      评论:0      收藏:0      [点我收藏+]

docker仓库存储后端使用glusterfs


环境

192.168.0.206 glusterfs1

192.168.0.228 glusterfs2

192.168.0.193 glusterfs3

192.168.0.220 docker-registry

系统

Centos 7

 

Glusterfs1-3配置

 

编辑/etc/hosts文件,添加如下内容,相互解析

192.168.0.206 glusterfs1

192.168.0.228 glusterfs2

192.168.0.193 glusterfs3

 

  1. 安装yum

rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

 

2.下载glusterfs

wget –P /etc/yum.repos.dhttp://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo

3.安装

  Yum–y install glusterfs glusterfs-fuse glusterfs-server

4.启动

  Systemctlstart glusterd.service

5.创建存储目录

   mkdir–p /usr/local/share/models

 

Glusterfs1上配置

1.配置集群

[root@glusterfs1~]# gluster peer probe glusterfs1
peer probe: success. Probe on localhost not needed

[root@glusterfs1~]# gluster peer probe glusterfs2

peer probe: success.
[root@glusterfs1~]# gluster peer probe glusterfs3
peer probe: success.

2.     创建一个卷组

 gluster volume create modelsglusterfs1:/usr/local/share/models glusterfs2:/usr/local/share/models glusterfs3:/usr/local/share/modelsforce

3.启动

  gluster volume start models

4.检查

gluster peerstatus  查看peer状态

glustervolume info

glustervolume status   gluster peer probe HOST(peer的主机名)

gluster peerdetach HOST

docker-registry上安装 

1.安装yum

rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

 

2.下载glusterfs

wget –P /etc/yum.repos.dhttp://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo

3.安装

  yum–y install glusterfs glusterfs-fuse glusterfs-server

  1. 创建一个挂载目录

mkdir /mnt/glusterfs

  1. 挂载

mount -t glusterfs -o glusterfs1:models /mnt/models/

6.安装dockerregistry

  yum–y install docker

 docker pull registry

  dockerrun -d -p 5000:5000 -v /mnt/models:/tmp/registry docker.io/registry

 


Docker-registry + GlusterFS

原文:http://zengxh.blog.51cto.com/10650604/1721740

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!