温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-07-20 00:57:03 来源:网络 阅读:2034 作者:fei_0123456789 栏目:开发技术


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


首先,把准备的镜像从网络上下载或直接拷贝到/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服务 

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI