赞
踩
1.第一阶段学习方法
1.记命令 80-150
2.记参数 常用 3-5个
3.练习 考试题手写
4.回顾 总结
2.第二阶段学习方法
1.理解 思考 提问
2.应用场景 干嘛用的 怎么用
3.安装部署 配置文件 启动 测试 关闭
4.各种报错 看日志 看日志 看日志 收集 整理
5.英文单词量积累 不然看不懂报错
综合架构规划
主机名称和IP地址规划
系统 CentOS7
内存 建议2G
网卡 eth0: NAT模式 模拟外网 10.0.0.x
eth1: LAN区段 模拟内网 172.16.1.x
硬盘 不小于20G或40G
修改网卡名称:
net.ifnames=0 biosdevname=0
[root@oldboyedu ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=10.0.0.201
PREFIX=24
GATEWAY=10.0.0.254
DNS1=10.0.0.254
[root@oldboyedu ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=static
IPADDR=172.16.1.201
PREFIX=24
NAME=eth1
DEVICE=eth1
ONBOOT=yes
[root@oldboyedu ~]# systemctl restart network
如果不删除,重新克隆虚拟机会导致上不了网
删除网卡里面包含UUID 的行(centos7),删除UUID和HWADDR(CentOS5和6)
清空/etc/udev/rules.d/70-persistent-net.rules(centos 5 和6)
关闭firewalld 和NetworkManager
[root@oldboyedu ~]# systemctl stop firewalld NetworkManager
[root@oldboyedu ~]# systemctl disable firewalld NetworkManager
#检查是否正在运行
systemctl is-active firewalld NetworkManager
#检查是否开机自启动
systemctl is-enabled firewalld NetworkManager
[root@oldboyedu ~]# systemctl is-active firewalld NetworkManager crond
unknown
inactive
active
[root@oldboyedu ~]# systemctl is-enabled firewalld NetworkManager crond
disabled
disabled
enabled
关闭selinux
[root@oldboyedu ~]# grep =disable /etc/selinux/config
SELINUX=disabled
[root@oldboyedu ~]# setenforce 0
[root@oldboyedu ~]# getenforce
Permissive
[root@oldboyedu ~]# egrep -n ‘^(GSSAPIA|UseDNS)’ /etc/ssh/sshd_config
79:GSSAPIAuthentication no
115:UseDNS no
[root@oldboyedu ~]# systemctl restart sshd.service
export PS1="[[\e[34;1m]\u@[\e[0m][\e[32;1m]\H[\e[0m] [\e[31;1m]\w[\e[0m]]\$ "
查看yum源
yum repolist
CentOS 7系统默认的源更新
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
增加epel源
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install -y tree vim wget bash-completion bash-completion-extras lrzsz net-tools sysstat iotop iftop htop unzip telnet ntpdate
[root@oldboyedu ~]# grep oldboy /etc/sudoers
oldboy ALL=(ALL) NOPASSWD: ALL
10.0.1.5 172.16.1.5 lb01
10.0.1.6 172.16.1.6 lb02
10.0.1.7 172.16.1.7 web01
10.0.1.8 172.16.1.8 web02
10.0.1.9 172.16.1.9 web03
10.0.1.31 172.16.1.31 nfs
10.0.1.41 172.16.1.41 backup
10.0.1.51 172.16.1.51 db01
10.0.1.61 172.16.1.61 m01
10.0.1.71 172.16.1.71 zabbix
ntpdate time1.aliyun.com
网卡图解
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。