Linux 初始化检查列表1

2021-11-26 10:33:11 浏览数 (1)

前言

一台新开的云主机,我们往往需要对其进行初始化,或加入一些简单的调优参数,以适应测试或生产的基本需求

这里简要分享一下Linux初始化的检查列表,以帮忙更为高效地进行检查确认


概要


环境

这里以一台Centos6的服务器进行演示

代码语言:javascript复制
[root@localhost ~]# uname -a 
Linux localhost.localdomain 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# lsb_release 
LSB Version:	:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
[root@localhost ~]# cat /etc/issue
CentOS release 6.7 (Final)
Kernel r on an m

[root@localhost ~]#

网络

网络是最先要解决的问题

外网联通

首先要配通网络,以使其可以获得各种网络资源

网络包含:

  • IPADDR/NETMASK
  • GATEWAY
  • DNS
代码语言:javascript复制
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1 
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1  
DEVICE=eth1
TYPE=Ethernet
UUID=c3a6fb7b-0970-4d76-8871-26e18d500ceb
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.22.121
NETMASK=255.255.255.0
GATEWAY=192.168.22.10
DNS1=210.22.84.3
DNS2=114.114.114.114
[root@localhost ~]# /etc/init.d/network restart 
Shutting down interface eth1:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth1:  Determining if ip address 192.168.22.121 is already in use for device eth1...
                                                           [  OK  ]
[root@localhost ~]# ping www.baidu.com
PING www.a.shifen.com (115.239.210.27) 56(84) bytes of data.
64 bytes from 115.239.210.27: icmp_seq=1 ttl=52 time=5.48 ms
64 bytes from 115.239.210.27: icmp_seq=2 ttl=52 time=5.42 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1155ms
rtt min/avg/max/mdev = 5.427/5.456/5.486/0.079 ms
[root@localhost ~]#

0 人点赞