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环境 ...
随机推荐
- Cobalt Strike 连接启动教程,制作图片🐎(2)
扫描有两种方式:arp 和 icmp 查看进程列表 攻击----生成后门-----Payload 可以生成各类语言免杀牧马---(输出:选择C或者python或者php) go.咕.com 生成c语言 ...
- Spring boot+vue打包、上传宝塔面板并配置https
终于把网站搞完了,也终于能够通过域名访问了,这次就简单回顾一下这么多时间的经历,总结一下. 项目地址穆音博客,本文发布原地址在Spring boot+vue打包.上传宝塔面板并配置https 我的开发 ...
- 手摸手带你 在Windows系统中安装Istio
Istio简介 通过负载均衡.服务间的身份验证.监控等方法,Istio 可以轻松地创建一个已经部署了服务的网络,而服务的代码只需很少更改甚至无需更改. 通过在整个环境中部署一个特殊的 sidecar ...
- 【一步步开发AI运动小程序】十一、人体关键点跳跃追踪
随着人工智能技术的不断发展,阿里体育等IT大厂,推出的"乐动力"."天天跳绳"AI运动APP,让云上运动会.线上运动会.健身打卡.AI体育指导等概念空前火热.那 ...
- 可以,很强,68行代码实现Bean的异步初始化,粘过去就能用。
你好呀,我是歪歪. 前两天在看 SOFABoot 的时候,看到一个让我眼前一亮的东西,来给大家盘一下. SOFABoot,你可能不眼熟,但是没关系,本文也不是给你讲这个东西的,你就认为它是 Sprin ...
- 从源码级剖析Java类加载原理
相信大多数熟悉Java的研发工程师,都知道Java类加载原理:Java中的类是由类加载器采用双亲委派机制进行加载.其中,Java核心库中实现了三种类型的类加载器,它们分别是:引导类加载器Bootstr ...
- Git使用教程(带你玩转GitHub)
Git使用教程(理论实体结合体系版) 下载安装: 按照这个博客来就好 Windows系统Git安装教程(详解Git安装过程) - 学为所用 - 博客园 (cnblogs.com) Git命令大全: G ...
- 人工智能智能城市(AIinSmartCities)领域的100篇热门博客文章标题如下:
目录 人工智能智能城市(AI in Smart Cities)领域的100篇热门博客文章标题如下: 1.<智能城市与大数据:未来城市大脑的发展方向> 2.<智能交通系统的设计与实现& ...
- 可视化容器管理工具-portainer.io使用
续docker日常使用指南 背景 当我们开始使用docker后,我们的机器上镜像和容器会越来越多,或者有时候我们有多台开发机的时候,单纯使用命令行去管理镜像和容器就变得麻烦了,这时,我们就可以选择一些 ...
- 暗黑2能用Java开发?还能生成APP?
最近烧哥发现个宝藏项目,竟然用Java开发了暗黑2出来. 众所周知,暗黑2是暴雪开发的一款经典游戏,距今虽有20多年,仍然有很多粉丝. 粉丝延续热情的方式有很多,一种是做Mod,比如魔电,对怪物.技能 ...