溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

CentOS7配置本地鏡像及安裝gluster服務(wù)

發(fā)布時(shí)間:2020-07-20 00:57:03 來(lái)源:網(wǎng)絡(luò) 閱讀:2027 作者:fei_0123456789 欄目:開(kāi)發(fā)技術(shù)


【【【【【創(chuàng)建本地鏡像及安裝gluster操作手冊(cè)】】】】】


首先,把準(zhǔn)備的鏡像從網(wǎng)絡(luò)上下載或直接拷貝到/home/ecp2/mirror 目錄下(該目錄是根據(jù)該案例設(shè)定,可根據(jù)需要?jiǎng)?chuàng)建自己的文件目錄)

   1、sudo mkdir /home/ecp2/mirror         創(chuàng)建mirror目錄,把鏡像拷貝到mirror下  
 
   2. sudo mkdir -p /media/CentOS          創(chuàng)建CentOS目錄,把磁盤(pán).iso鏡像mount到CentOS目錄下

   3、sudo mount /dev/sr0 /media/CentOS    把iso安裝鏡像掛在到/media/CentOS 目錄下,該目錄是 /etc/yum.repos.d/CentOS-Media.repo  鏡像文件的baseurl默認(rèn)的第一個(gè)目錄

修改鏡像有效路徑:  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           -------這塊新增的內(nèi)容,配置為本地鏡像home/ecp2/mirror/extras/x86_64 路徑下的鏡像, 數(shù)字簽名為etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

CentOS7配置本地鏡像及安裝gluster服務(wù)



   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-------多出來(lái) 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                      ------這塊新增內(nèi)容配置鏡像home/ecp2/mirror/storage/x86_64/gluster-3.8 為之后安裝gluster,如【sudo yum install glusterfs-server glusterfs glusterfs-fuse】


CentOS7配置本地鏡像及安裝gluster服務(wù)


  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環(huán)境 glusterfs-server glusterfs glusterfs-fuse
 
  9、sudo systemctl list-unit-files glusterd.service                        -----該命令查看gluster服務(wù)是否啟動(dòng)
 
  10、sudo systemctl enable glusterd.service && sudo systemctl start glusterd.service      ----sudo systemctl enable glusterd.service設(shè)置開(kāi)機(jī)啟動(dòng), sudo systemctl start glusterd.service
 
  11、sudo systemctl -l status glusterd.service    --查看gluster服務(wù)啟動(dòng)狀態(tài)
 
[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服務(wù)
  12、sudo netstat -tpnl                           --查看服務(wù)信息(哪些服務(wù)在啟動(dòng),占用端口等信息)

CentOS7配置本地鏡像及安裝gluster服務(wù) 

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI