Linux云计算学习笔记day31

综合架构模板机优化指南:
vim /etc/profile

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连接速度慢

79 GSSAPIAuthentication no

vim /etc/ssh/sshd_config

远程连接的时候 关闭把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台机器
-综合架构-backup-10.0.0.41 backup 10.0.0.41 172.16.1.41
-综合架构-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命令环境变量

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值