给自己的提醒
1、首先在Iaas平台,创建两台云主机,一台作为仓库registry,一台作为客户端client,在v2.1版本,还是需要一台server的机器,但是2.2版本server和registry已经融为一体了,所以只需要两台机器。
下面四点 在registry和server节点都需要配置!!!
1、关闭selinux
2、关闭防火墙
3、删除iptables防火墙规则
4、修改系统内核,打开内核转发功能
关闭Selinux
[root@registry ~]# vim /etc/selinux/config
#SELINUX=disabled
[root@registry ~]# setenforce 0 #临时设置selinux为permissive 重启才能永久保存。
[root@registry ~]# getenforce
Disabled
关闭防火墙
[root@registry ~]# systemctl stop firewalld
[root@registry ~]# systemctl disable firewalld
[root@registry ~]# systemctl status firewalld
删除iptables规则
[root@registry ~]# iptables -F
[root@registry ~]# iptables -X
[root@registry ~]# iptables -Z
[root@registry ~]# /usr/sbin/iptables-save
#Generated by iptables-save v1.4.21 on Wed Jan 15 01:59:08 2020
*filter
:INPUT ACCEPT [49:3260]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [26:2408]
COMMIT
#Completed on Wed Jan 15 01:59:08 2020
修改系统内核
[root@registry ~]# vim /etc/sysctl.conf
#net.ipv4.ip_forward = 1
#net.ipv4.conf.default.rp_filter = 0
#net.ipv4.conf.all.rp_filter = 0
[root@registry ~]# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
5、修改hostname和修改/etc/hosts文件。
registry节点:
[root@registry ~]# hostnamectl set-hostname registry
[root@registry ~]# bash
[root@registry ~]# hostname
registry
[root@registry ~]# vim /etc/hosts
10.0.0.104 registry
10.0.0.105 client
把hosts文件scp到client节点上
[root@registry ~]# scp /etc/hosts client:/etc/hosts
The authenticity of host ‘client (10.0.0.105)’ can’t be established.
ECDSA key fingerprint is 37:48:34:56:ad:65:08:c1:0b:53:35:ce:fc:4f:c0:3e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘client’ (ECDSA) to the list of known hosts.
hosts 100% 197 0.2KB/s 00:00
client节点:
[root@client ~]# hostnamectl set-hostname client
[root@client ~]# bash
[root@client ~]# hostname
client
[root@client ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.104 registry
10.0.0.105 client
[root@client ~]# ping registry
PING registry (10.0.0.104) 56(84) bytes of data.
64 bytes from registry (10.0.0.104): icmp_seq=1 ttl=64 time=0.476 ms
64 bytes from registry (10.0.0.104): icmp_seq=2 ttl=64 time=0.504 ms
64 bytes from registry (10.0.0.104): icmp_seq=3 ttl=64 time=0.396 ms
6、配置Yum仓库,首先把paas2.2的镜像上传到registry节点上,把光盘以块的方式挂载到/mnt目录下,复制所有的目录或文件到/opt目录下,配置好regisrty的Yum源,再安装vsftpd服务,为client的Yum仓库提供帮助。
regisr