Linux配置yum源

#Controllercompute节点

1yum源备份

#mv /etc/yum.repos.d/*  /opt/

2)创建repo文件

controller

/etc/yum.repos.d创建centos.repo源文件

[centos]

name=centos

baseurl=file:///opt/centos

gpgcheck=0

enabled=1

[iaas]

name=iaas

baseurl=file:///opt/iaas-repo

gpgcheck=0

enabled=1

compute

/etc/yum.repos.d创建centos.repo源文件

[centos]

name=centos

baseurl=ftp://192.168.100.10/centos

gpgcheck=0

enabled=1

[iaas]

name=iaas

baseurl=ftp://192.168.100.10/iaas-repo

gpgcheck=0

enabled=1

3)挂载iso文件

挂载CentOS-7-x86_64-DVD-1804.iso

[root@controller ~]# mount -o loop CentOS-7-x86_64-DVD-1804.iso  /mnt/

[root@controller ~]# mkdir /opt/centos

[root@controller ~]# cp -rvf /mnt/* /opt/centos/

[root@controller ~]# umount  /mnt/

【挂载XianDian-IaaS-v2.4.iso

[root@controller ~]# mount -o loop XianDian-IaaS-v2.4.iso  /mnt/

[root@controller ~]# cp -rvf /mnt/* /opt/

[root@controller ~]# umount  /mnt/

4)搭建ftp服务器,开启并设置自启

[root@controller ~]# yum install vsftpd -y

[root@controller ~]# vi /etc/vsftpd/vsftpd.conf

添加anon_root=/opt/

保存退出

[root@controller ~]# systemctl start vsftpd

[root@controller ~]# systemctl enable vsftpd

5)配置防火墙和Selinux 

controller/compute

编辑selinux文件

# vi /etc/selinux/config

SELINUX=permissive

关闭防火墙并设置开机不自启

# systemctl stop firewalld.service

# systemctl disable firewalld.service

# yum remove -y NetworkManager firewalld

# yum -y install iptables-services

# systemctl enable iptables

# systemctl restart iptables

# iptables -F

# iptables -X

# iptables -Z

# service iptables save

6)清除缓存,验证yum 

controller/compute

# yum clean all

# yum list

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

离陌殇殃

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值