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环境 ...
随机推荐
- docker 部署 springboot项目和直接运行 jar 文件详细步骤
目前docker发布springboot有两种方式,一种是制作镜像,另一种是直接运行jar 文件 第一种使用镜像来部署 一.创建项目目录 [root@dex ~]# mkdir /opt/backst ...
- web自动化01-环境搭建
1.自动化测试是什么? 借助工具实现 借助代码编写脚本实现 2.自动化测试需要掌握那些? web自动化测试基础 移动端自动化基础 pytest自动化测试框架 po设计模式 数据驱动 日志模块使用 自 ...
- kafka集群是如何选择leader,你知道吗?
前言 kafka集群是由多个broker节点组成,这里面包含了许多的知识点,以下的这些问题你都知道吗? 你知道topic的分区leader是怎么选举的吗? 你知道zookeeper中存储了kafka的 ...
- 如何使用Go中的Weighted实现资源管理
1. 简介 本文将介绍 Go 语言中的 Weighted 并发原语,包括 Weighted 的基本使用方法.实现原理.使用注意事项等内容.能够更好地理解和应用 Weighted 来实现资源的管理,从而 ...
- 让优惠再续一年!SHPC 老客专享
最近云筏君经常收到自家小伙伴发来的关于产品活动的关心慰问,掐指一算,哦,原来是一年一度大家喜闻乐见的剁手节(学名"双十一")马上要来了! 大家都知道,云筏家的产品向来主打高性价比, ...
- 经纬度坐标为中心点生成米距离长度半径的圆形面,含java js源码+在线绘制,代码简单零依赖
目录 java版源码 js版源码 在线绘制预览效果 关于计算的精确度 前些时间在更新我的坐标边界查询工具的时候,需要用到经纬度坐标点的距离计算,和以坐标点为中心生成一个指定距离为半径的圆,搜了一下没有 ...
- WPF实现新手引导
1. 半透明灰的遮罩层 新建一个遮盖的window窗体 canvas是后期可以在思显示高亮区域 //定义一个window将它的样式设置透明等可以覆盖到其他窗体上,其中遮罩层使用border控件 //原 ...
- LLE算法在自然语言生成中的应用:实现文本到语音的情感迁移
目录 自然语言生成(Natural Language Generation,NLP)是人工智能领域的一个分支,它利用大量的文本数据训练出语言模型,从而实现对自然语言的生成和理解.在NLP中,情感迁移( ...
- 基于VAE的风险分析:基于历史数据的风险分析、基于实时数据的风险分析
目录 引言 随着人工智能和机器学习的发展,风险分析已经成为许多行业和组织中不可或缺的一部分.传统的基于经验和规则的风险分析方法已经难以满足现代风险分析的需求,因此基于VAE的风险分析方法逐渐成为了主流 ...
- 【python基础】文件-初识文件
文本文件可存储的数据量是非常多的.每当需要分析或修改存储在文件中的信息时,首先就是读取文件到内存中,为此可以一次性读取文件的全部内容,也可以以每次一行的方式逐步读取. 1.读取文件 1.1读取整个文件 ...