centos8环境基本优化
centos8环境基本优化
1.防火墙优化
参考链接
https://www.cnblogs.com/zttong/p/17511695.html
systemctl stop firewalld && systemctl disable firewalld
cat /etc/selinux/config
setenforce 0 && sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/selinux/config
2.源优化:
方案1.更换阿里源
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
yum makecache
安装epel源
dnf install epel-release -y
方案2.使用centos8.5 源
[root@models yum.repos.d]# cat CentOS8-vault.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-8.5.2111 - Base - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/BaseOS/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful
[extras]
name=CentOS-8.5.2111 - Extras - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/extras/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-8.5.2111 - Plus - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/centosplus/$basearch/os/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[PowerTools]
name=CentOS-8.5.2111 - PowerTools - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/PowerTools/$basearch/os/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[AppStream]
name=CentOS-8.5.2111 - AppStream - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/AppStream/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
安装epel源
dnf install epel-release -y
3.ssh连接慢解决
ll /etc/ssh/sshd_config
vim /etc/ssh/sshd_config
GSSAPIAuthentication no
UseDNS no
[root@oldboy-muban ~]# egrep '^GSSAPIA|^UseDNS'
/etc/ssh/sshd_config
GSSAPIAuthentication no
UseDNS no
systemctl restart sshd 未来连接速度就很快
4.关闭公网,只开放内网(可选)
[root@huge-muban ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi
user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus
org.freedesktop.nm-dispatcher.service.
Removed symlink /etc/systemd/system/network
online.target.wants/NetworkManager-wait-online.service.
[root@huge-muban ~]# systemctl stop NetworkManager
5.配置定时任务,时间同步
centos7 ntpd
crontab -e
# sync time by huge
*/2 * * * * /sbin/ntpdate ntp1.aliyun.com &>/dev/null
centos8
[root@models yum.repos.d]# rpm -qa |grep chrony
chrony-3.5-1.el8.x86_64
dnf install chrony -y
6.PS1
PS1 控制命令行格式
man bash 搜索PS1
vim /etc/profile 最后一行写入
export PS1='[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ '
[root@huge-muban ~]# tail -1 /etc/profile
export PS1='[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\
[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ '
[root@huge-muban ~]# source /etc/profile
[故障集合]Linux必备故障及原因50个
https://www.jianshu.com/p/99ec5bb4183f
7.配置sudo
[root@huge-muban ~]$ grep wheel /etc/sudoers
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
# %wheel ALL=(ALL) NOPASSWD: ALL
[root@oldboy-muban ~]$ id huge
uid=1000(hueg) gid=1000(huge)
groups=1000(huge),10(wheel)
想要配置可以这么操作
huge ALL=(ALL) NOPASSWD: ALL
centos8环境基本优化的更多相关文章
- kafka在虚拟机环境的优化
首先是,多磁盘的并发的问题.不管怎么说,虚拟机环境至少剥夺了单个kafka同时使用多个磁盘的优势.也就意味着,在同一个虚拟机,同一个topic,最好只有一partition:当然,不同topic之间p ...
- LNMP环境并发优化
LNMP环境并发优化 服务器 8核32Gx3 如图是一条http请求的生命周期,共经过nginx,php-fpm,PHP三个模块 所以我们可以从nginx,php-fpm,PHP三个维度去优化 一.p ...
- (转)CentOS(5.8/6.4)linux生产环境若干优化实战
CentOS(5.8/6.4)linux生产环境若干优化实战 原文:http://blog.51cto.com/oldboy/1336488 特别说明:本文来自老男孩linux培训VIP学生学习笔记. ...
- 离线版centos8环境部署迁移监控操作笔记
嗨咯,前两天总结记录了离线版centos8下docker的部署笔记,今天正好是2021年的最后一天,今天正好坐在本次出差回家的列车上,车上没有上面事做,索性不如把本次离线版centos8环境安装的其他 ...
- CentOS(5.8/6.7)linux生产环境若干优化实战
CentOS系统安装之后并不能立即投入生产环境使用,往往需要先经过我们运维人员的优化才行.在此讲解几点关于Linux系统安装后的基础优化操作.注意:本次优化都是基于CentOS(5.8/6.7). 下 ...
- Spring Cloud 生产环境性能优化
先思考几个问题: 什么是百万并发连接? 什么是吞吐量? 操作系统能否支持百万连接? 操作系统维持百万连接需要多少内存? 应用程序维持百万连接需要多少内存? 百万连接的吞吐量是否超过了网络限制? 百万的 ...
- Android Studio 环境配置优化
一.插件 .ignore: 版本控制忽略文件高亮和补齐ADB Idea: ctrl + Shift + A 查找中添加常用卸载安装app的一些操作,无需命令行Android ButterKnife Z ...
- myeclipse 环境配置优化,不断跟新整理中
myeclipse 环境配置,不断跟新整理中1.General --->Workspace ---> UTF-8 工作环境编码2.General --->Editors --> ...
- 生产环境MySQL优化
a:硬件的优化: 1. 采用64位cpu,cpu至少4颗,L2缓存越大越好2. 内存要大,32-64G运行1-2个实例,96-128G运行3-4个实例3. 机械盘选用sas盘,转速15000以上,有可 ...
- centos8环境判断当前操作系统是否虚拟机或容器
一,阿里云ECS的centos环境 1,执行systemd-detect-virt [root@yjweb ~]# systemd-detect-virt kvm 说明阿里云的ecs是在一个kvm环境 ...
随机推荐
- How to use the shell command to get the version of Linux Distributions All In One
How to use the shell command to get the version of Linux Distributions All In One 如何使用 shell 命令获取 Li ...
- API NEWS | 三个Argo CD API漏洞
欢迎大家围观小阑精心整理的API安全最新资讯,在这里你能看到最专业.最前沿的API安全技术和产业资讯,我们提供关于全球API安全资讯与信息安全深度观察. 本周,我们带来的分享如下: 关于三个Argo ...
- C# .NET CORE .NET6 RSA 公钥加密 私钥解密
环境说明: .NET CORE 版本:.NET 6 . .NET CORE 对于RSA的支持: 1. .NET 6 中内置了对 PKCS1,PKCS8 2种私钥格式的支持. 2. 如果你要部署在Lin ...
- JVM、JRE和JDK的理解
JVM JVM,全称为Java Virtual Machine,中文的意思是:Java虚拟机. 在理解Java虚拟机这个定义之前,我们先讲讲为何叫虚拟机呢?称为虚拟机,顾名思义,它应该不是真实存在 ...
- Python爬虫(二):写一个爬取壁纸网站图片的爬虫(图片下载,词频统计,思路)
好家伙,写爬虫 代码: import requests import re import os from collections import Counter import xlwt # 创建Ex ...
- TVM-MLC LLM 调优方案
本文地址:https://www.cnblogs.com/wanger-sjtu/p/17497249.html LLM 等GPT大模型大火以后,TVM社区推出了自己的部署方案,支持Llama,Vic ...
- 基于C# 开发的SOL SERVER 操作数据库类(SQLHelp)
说明:以下是我近两年年来开发中最常用的C#操作sql server数据库访问类,对初学者非常有用,容易扩展,支持多库操作,多研究研究,有什么问题欢迎留言 当前环境为 C# .NET CORE 3.0 ...
- C++内存模型&空指针、野指针、函数指针和回调函数
C++内存模型&空指针.野指针.函数指针和回调函数 C++内存模型 栈与堆的区别: 1.管理方式不同 栈是系统自动管理的,在超出作用域后,将自动被释放 堆是手动释放,若程序中不释放,程序结束后 ...
- Nacos服务发现与注册源码剖析
为什么要看源码: 1.提升技术功底:学习源码里的优秀设计思想,比如一些疑难问题的解决思路,还有一些优秀的设计模式,整体提升自己的技术功底2.深度掌握技术框架:源码看多了,对于一个新技术或框架的掌握速度 ...
- Asp-Net-Core学习笔记:gRPC快速入门
前言 此前,我在做跨语言调用时,用的是 Facebook 的 Thrift,挺轻量的,还不错. Thrift是一种接口描述语言和二进制通讯协议,它被用来定义和创建跨语言的服务.它被当作一个远程过程调用 ...