CentOS7配置本地镜像及安装gluster服务
admin
2023-07-31 09:03:24
0


【【【【【创建本地镜像及安装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服务 

相关内容

热门资讯

中国试射导弹,日本一天发两份声... 中国试射潜射导弹的消息成为6日以来日本舆论关注的焦点之一。日本政府一天内连续发表两份声明。中方强调,...
特朗普挥舞“关税大棒”折腾一年... 美国总统特朗普去年4月对美国所有的贸易伙伴挑起关税战,可能相当于白折腾了一年。据美国彭博社报道,当地...
深圳加码青少年AI教育!龙华启... 深圳青少年AI教育再加码!美中AI产学研基地启幕仪式暨项目发布会近日在龙华区举行,融合科研创新、产业...
活力中国调研行丨地下方寸造“宇... 长久以来,人类探索宇宙主要依靠远距离天文观测,只能被动捕捉太空信号。在上海交通大学李政道研究所,科研...
千亿航天计划2027年开始部署... 千亿航天计划在2027年上半年“玄鸟-R”首飞任务开始,在晨昏轨道部署12500颗“阿莱耶识”算力卫...
实探深圳AI硬件企业:从百元玩... 图源:视觉中国 时代财经获悉,近日,逐际动力与阿里云联合打造的具身智能标准化工程底座 FluxVLA...
数字孪生能为工业仓储数智化升级... 当前国内智能制造、供应链物流领域正处于数智化转型的关键阶段,仓储作为物流链路的核心节点,其运营效率直...
【光明时评】让夏收跑出科技“加... 【光明时评】 作者:段蕾 翟卫欣(中国农业大学马克思主义学院副教授、中国农业大学信息与电气工程学院副...
解放军两年内两次试射导弹,意味... 7月6日12时01分,中国海军成功组织潜射战略导弹试射。2024年9月25日8时44分,中国人民解放...
新加坡巡回大使:中美关系稳定将... 据凤凰卫视报道,第八届新中论坛7月6日在新加坡举行。新加坡巡回大使陈庆珠认为,中美保持稳定关系,将为...