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命令环境变量

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 1、什么是集群? 简单地说,集群就是一堆机器做同一件事,例如:www.jd.com提供卖东西服务这就是一件事,可能...
    余仔丶阅读 281评论 0 0
  • 1、什么是集群? 简单地说,集群就是一堆机器做同一件事, 例如:www.jd.com提供卖东西服务这就是一件事,可...
    放手吧_e512阅读 328评论 0 1
  • 思想 1、什么是集群? 简单地说,集群就是一堆机器做同一件事, 例如:www.jd.com提供卖东西服务这就是一件...
    喂00阅读 220评论 0 0
  • 七夕没有什么浪漫的故事,只是碰巧写在这一天,让这些唠叨带着七夕的光环,也别有风味。吃喝玩乐,这吃是极其重要...
    life_240b阅读 584评论 0 3
  • 不要试图打造完美人设,因为这个世界本就不存在完美。 个人品牌传播的过程其实和相亲处对象很相似,同样也会有两大误区。...
    巧栗子阅读 724评论 0 2

友情链接更多精彩内容