2019-05-16日课程总结

综合架构模板机优化指南:

export PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ "

网卡配置:

eth0: 10.0.0.201    公网 
eth1: 172.16.1.201  内网
[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 
[root@oldboyedu ~]# ip a |grep 201
    inet 10.0.0.201/24 brd 10.0.0.255 scope global noprefixroute eth0
    inet 172.16.1.201/24 brd 172.16.1.255 scope global noprefixroute eth1

关闭selinux和firewalld NetworkManager

关闭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  

配置yum源

查看yum源? repo 源 意思

/etc/yum.repos.d/ 系统yum源的存放位置 xxx.repo ooo.repo

yum repolist

 [root@oldboyedu ~]# yum  repolist 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.huaweicloud.com
repo id                                    repo name                                     status
base/7/x86_64                              CentOS-7 - Base                               10,019
extras/7/x86_64                            CentOS-7 - Extras                                413
updates/7/x86_64                           CentOS-7 - Updates                             1,928
repolist: 12,360
 yum groups mark convert
 yum grouplist 

 Installed Groups:
   Compatibility Libraries
   Development Tools
   Legacy UNIX Compatibility
   Milkymist
   Security Tools
   System Administration Tools

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

curl :命令访问网站工具

http://mirrors.aliyun.com

安装常见工具

tree vim wget bash-completion bash-completion-extras lrzsz net-tools sysstat iotop iftop htop unzip nc nmap telnet bc psmisc

解决ssh连接速度慢

vim /etc/ssh/ssh_config

79 GSSAPIAuthentication no 

远程连接的时候 关闭把ip地址转换为域名 功能

115 UseDNS no   
[root@oldboyedu ~]# egrep -n '^(GSSAPIA|UseDNS)' /etc/ssh/sshd_config 
79:GSSAPIAuthentication no
115:UseDNS no
[root@oldboyedu ~]# systemctl restart sshd.service 
[root@oldboyedu ~]# grep oldboy  /etc/sudoers
oldboy  ALL=(ALL)     NOPASSWD: ALL

克隆2台机器

老男孩教育59期-综合架构-backup-10.0.0.41 backup 10.0.0.41 172.16.1.41
老男孩教育59期-综合架构-nfs01-10.0.0.31 nfs01 10.0.0.31 172.16.1.31

环境变量:

PS1
PATH
LANG
TMOUT timeout

https://www.jianshu.com/p/b462820f7fe5
常用工具
history命令环境变量

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1、什么是集群? 简单地说,集群就是一堆机器做同一件事, 例如:www.jd.com提供卖东西服务这就是一件事,可...
    Linux_wu_sir阅读 775评论 0 0
  • 综合架构模板机优化指南:export PS1="[[\e[34;1m]\u@[\e[0m][\e[32;1m]\H...
    a狂飙的蜗牛阅读 3,153评论 0 0
  • 1、什么是集群? 简单地说,集群就是一堆机器做同一件事, 例如:www.jd.com提供卖东西服务这就是一件事,可...
    山有木兮_8adb阅读 1,384评论 0 0
  • 1、什么是集群? 简单地说,集群就是一堆机器做同一件事, 例如:www.jd.com提供卖东西服务这就是一件事,可...
    Wave_e430阅读 923评论 0 0
  • 编者按 《卡特教练》又名《铁血教练 》、《放牛班的严冬》。是根据真人真事改编的一部体育励志片。讲述了一位高中篮球教...
    不二侠阅读 4,310评论 0 0