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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7配置本地镜像及安装gluster服务相关的知识,希望对你有一定的参考价值。


【【【【【创建本地镜像及安装gluster操作手册】】】】】
   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默认的第一个目录
   
[[email protected] 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           -------这块新增的内容,配置为本地镜像home/ecp2/mirror/extras/x86_64 路径下的镜像, 数字签名为etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

   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    ----修改镜像配置
[[email protected] 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】


技术分享


  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服务启动状态
 
[[email protected] 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.


技术分享
  12、sudo netstat -tpnl                           --查看服务信息(哪些服务在启动,占用端口等信息)

技术分享 

以上是关于CentOS7配置本地镜像及安装gluster服务的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7安装gluster分布式文件系统(取名glustervol1),附CentOS7安装git

云计算:Docker安装及本地镜像仓库配置

centos7配置本地yum源 使用安装镜像安装软件

CentOS7.2配置本地yum源

centOS7-本地源配置

Docker安装及阿里云镜像加速器配置