我们专注攀枝花网站设计 攀枝花网站制作 攀枝花网站建设
成都网站建设公司服务热线:400-028-6601

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

CentOS7配置本地镜像及安装gluster服务-创新互联

【【【【【创建本地镜像及安装gluster操作手册】】】】】

我们提供的服务有:做网站、成都网站制作、微信公众号开发、网站优化、网站认证、润州ssl等。为千余家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的润州网站制作公司

首先,把准备的镜像从网络上下载或直接拷贝到/home/ecp2/mirror 目录下(该目录是根据该案例设定,可根据需要创建自己的文件目录)

  1、sudo mkdir /home/ecp2/mirror        创建mirror目录,把镜像拷贝到mirror下

  2. sudo mkdir -p /media/CentOS         创建CentOS目录,把磁盘.iso镜像mount到CentOS目录下

  3、sudo mount /dev/sr0 /media/CentOS   把iso安装镜像挂在到/media/CentOS 目录下,该目录是 /etc/yum.repos.d/CentOS-Media.repo 镜像文件的baseurl默认的第一个目录

修改镜像有效路径: sudo vi /etc/yum.repos.d/CentOS-Media.repo

[ecp2@localhost root]$ sudo vi /etc/yum.repos.d/CentOS-Media.repo
# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-7. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c7-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c7-media [command]

[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
       file:///media/cdrom/
       file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[offline-extras]
name=CentOS-$releasever - Media
baseurl=file:///home/ecp2/mirror/extras/x86_64
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7          -------这块新增的内容,配置为本地镜像home/ecp2/mirror/extras/x86_64 路径下的镜像, 数字签名为etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

CentOS7配置本地镜像及安装gluster服务

  4、sudo yum --disablerepo=\* --enablerepo=c7-media,offline-extras list | grep gluster  -----该命令是查看镜像中的gluster中的镜像 查看安装gluster安装的镜像,如【centos-release-gluster38.noarch 】
  5、sudo yum --disablerepo=\* --enablerepo=c7-media,offline-extras install centos-release-gluster38.noarch ----该命令 安装centos-release-gluster38.noarch

  5.1、 ls /etc/pki/rpm-gpg/                                  ------------查看pki-------多出来 RPM-GPG-KEY-CentOS-SIG-Storage
  5.2、 ls /home/ecp2/mirror/storage/x86_64/gluster-3.8       ------------新生成的镜像

  6、sudo vi /etc/yum.repos.d/CentOS-Media.repo   ----修改镜像配置
[ecp2@localhost root]$ vi /etc/yum.repos.d/CentOS-Media.repo

# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-7. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c7-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c7-media [command]

[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
       file:///media/cdrom/
       file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[offline-extras]
name=CentOS-$releasever - Media
baseurl=file:///home/ecp2/mirror/extras/x86_64
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[offline-storage-gluster38]
name=CentOS-$releasever - Media
baseurl=file:///home/ecp2/mirror/storage/x86_64/gluster-3.8
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-G                     ------这块新增内容配置镜像home/ecp2/mirror/storage/x86_64/gluster-3.8 为之后安装gluster,如【sudo yum install glusterfs-server glusterfs glusterfs-fuse】

CentOS7配置本地镜像及安装gluster服务

 7、sudo yum --disablerepo=\* --enablerepo=c7-media,offline-extras,offline-storage-gluster38 list | grep glusterfs ---查看新配置的镜像

 8、sudo yum --disablerepo=\* --enablerepo=c7-media,offline-extras,offline-storage-gluster38 install glusterfs-server glusterfs glusterfs-fuse -------安装gluster环境 glusterfs-server glusterfs glusterfs-fuse

 9、sudo systemctl list-unit-files glusterd.service                       -----该命令查看gluster服务是否启动

 10、sudo systemctl enable glusterd.service && sudo systemctl start glusterd.service     ----sudo systemctl enable glusterd.service设置开机启动, sudo systemctl start glusterd.service

 11、sudo systemctl -l status glusterd.service   --查看gluster服务启动状态

[ecp2@localhost x86_64]$ sudo systemctl -l status glusterd.service
● glusterd.service - GlusterFS, a clustered file-system server
  Loaded: loaded (/usr/lib/systemd/system/glusterd.service; enabled; vendor preset: disabled)
  Active: active (running) since 二 2017-03-14 14:05:07 CST; 45s ago
 Process: 18453 ExecStart=/usr/sbin/glusterd -p /var/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 18454 (glusterd)
  CGroup: /system.slice/glusterd.service
          └─18454 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO

3月 14 14:05:07 localhost.localdomain systemd[1]: Starting GlusterFS, a clustered file-system server...
3月 14 14:05:07 localhost.localdomain systemd[1]: Started GlusterFS, a clustered file-system server.

CentOS7配置本地镜像及安装gluster服务
 12、sudo netstat -tpnl                          --查看服务信息(哪些服务在启动,占用端口等信息)

CentOS7配置本地镜像及安装gluster服务

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


当前题目:CentOS7配置本地镜像及安装gluster服务-创新互联
转载来于:http://shouzuofang.com/article/disoci.html

其他资讯