码迷,mamicode.com
首页 > 其他好文 > 详细

saltstack之(一)系统环境及本地yum源

时间:2016-05-11 16:41:55      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:

1.服务器环境
node1:192.168.3.1
node2:192.168.3.2

2.主机名和hosts文件
node1: node1.xkops.com --主机名
[root@node1 ~]# tail -n 2 /etc/hosts
192.168.3.1 node1.xkops.com
192.168.3.2 node2.xkops.com

node2: node2.xkops.com --主机名
[root@node2 ~]# tail -n 2 /etc/hosts
192.168.3.1 node1.xkops.com
192.168.3.2 node2.xkops.com

3.关闭防火墙和selinux
node1:
service iptables stop
chkconfig iptables off
sed -i ‘/^SELINUX/s;enforcing;disabled;g‘ /etc/selinux/config
setenforce 0

node2:
service iptables stop
chkconfig iptables off
sed -i ‘/^SELINUX/s;enforcing;disabled;g‘ /etc/selinux/config
setenforce 0

4.配置本地yum源
node1:
mount /dev/sr0 /mnt
cd /etc/yum.repos.d/
mkdir backup && mv CentOS-* backup
[root@node1 yum.repos.d]# cat > CentOS-mnt.repo <<EOF
[CentOS6.5]
name=CT 6.5
baseurl=file:///mnt
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
EOF
[root@node1 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
repo id repo name status
CentOS6.5 CT 6.5 6,367
repolist: 6,367

node2:
mount /dev/sr0 /mnt
cd /etc/yum.repos.d/
mkdir backup && mv CentOS-* backup
[root@node2 yum.repos.d]# cat > CentOS-mnt.repo <<EOF
[CentOS6.5]
name=CT 6.5
baseurl=file:///mnt
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
EOF
[root@node2 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
repo id repo name status
CentOS6.5 CT 6.5 6,367
repolist: 6,367

saltstack之(一)系统环境及本地yum源

标签:

原文地址:http://www.cnblogs.com/xkops/p/5482256.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!