云商之softlayer与saltstack

       当前有众多的云服务商,不同云服务商提供的云主机镜像不同,配置文件大同小异。而这些小异的地方经常会造成许多麻烦,记录一下遇到的问题。接触过的云商有阿里,aws,微软,softlayer,edis,vuter,do等等主流的,也有一些sl之类的小服务商。在部署saltstack的初始化时,遇到了一些问题,记录在这里。

        本次记录的是softlayer

#uname -a

 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

#iptables --version

iptables v1.4.21

#ifconfig

-bash: ifconfig: command not found

pS:比较奇怪的是,iptables在sl的主机上运行的很奇怪。

启动要使用systemctl,停止要使用service,save也要使用service,开机启动要使用systemctl.其它的 -F -X用法都一样。

如果无法使用可以安装相关的iptables包,如devel和services包


#iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

  #ls /etc/yum.repos.d

CentOS-Base.repo  CentOS-Base.repo.orig  CentOS-Base.repo.rpmnew  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo

        通过上述命令,可以简单的得知sofllayer提供的CenO7.4镜像的一些情况。首先,这个版本的镜像是没有提供network工具包,因此需要通过yum来安装,其次,这个版本并没有使用firewall,反而是安装了iptables,并且没有设置任何规则。

        首次登录,yum -y install epel-release,如果不清楚ifocnfig的工具包。可以执行yum search ifconfig,

# yum search ifconfig

Loaded plugins: fastestmirror
epel/x86_64/metalink                                                                                                                                                                         | 6.9 kB  00:00:00     
epel                                                                                                                                                                                         | 4.7 kB  00:00:00     
(1/3): epel/x86_64/group_gz                                                                                                                                                                  |  84 kB  00:00:00     
(2/3): epel/x86_64/updateinfo                                                                                                                                                                | 922 kB  00:00:00     
(3/3): epel/x86_64/primary_db                                                                                                                                                                | 6.4 MB  00:00:00     
Loading mirror speeds from cached hostfile
 * epel: sjc.edge.kernel.org
================================================================================================ Matched: ifconfig =================================================================================================
moreutils.x86_64 : Additional unix utilities
net-tools.x86_64 : Basic networking tools

从上面可以得知工具包为net-tools,安装,yum -y install net-tools

# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.87.36.115  netmask 255.255.255.192  broadcast 10.87.36.127
        inet6 fe80::413:6ff:fe83:7593  prefixlen 64  scopeid 0x20<link>
        ether 06:13:06:83:75:93  txqueuelen 1000  (Ethernet)
        RX packets 7864  bytes 8237983 (7.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2593  bytes 226313 (221.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

。。。

可以使用ifconfig命令,可以看到默认为eth形式。

因为要做初始化部署,所以yum -y install salt-minion,systemctl start salt-minion


另外,selinux的级别是permissive,这点也需要注意

猜你喜欢

转载自blog.csdn.net/linux_s2018/article/details/80324325