centos设备性能优化
2022/7/3 5:19:26
本文主要是介绍centos设备性能优化,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
修改dns
vi /etc/resolv.conf
nameserver 114.114.114.114
修改防火墙 设置出网ip(自己更改网卡名和IP地址)
iptables -t nat -A POSTROUTING -o enp1s0 -j SNAT --to-source 0.0.0.0
安装基本工具
[root@localhost ~]# tar xvf optimization_init.tar.gz
[root@localhost ~]# cd optimization_init/
[root@localhost optimization_init]# ./optimization_init.sh
1. Going to set new hostname.... ##修改主机名
Are you sure to do that(Y/n)
2. Going to install Base and Development Tools.... ##安装基本工具和开发工具
Are you sure to do that(Y/n)
3. Going to install snmpd.... ##安装监控 snmpd服务
Are you sure to do that(Y/n)
4. Going to shutdown selinux ##是否关闭selinux--selinux的主要作用是限制root用户对操作系统中资源的操作权限
Are you sure to do that(Y/n)
5. Going to Change ssh port to 9777...... ##修改ssh端口为9777
Are you sure to do that,if is Thunder Server,please choose No(Y/n)
6. Going to Adjust time...... ##调整时间
Are you sure to do that(Y/n)
7. Going to change encoding ##更改编码
Are you sure to do that(Y/n)
8.Going to setup zebra ##设置zebra
Are you sure to do that(Y/n)
9. Going to Optimize for better performance...... ##优化模块
Are you sure to do that(Y/n)
10. Going to setup_icmp_mss...... ##通过iptables控制ICMP
Are you sure to do that(Y/n)
11. Going to create ssh keys...... ##修改ssh密码
Are you sure to do that(Y/n)
12. Going to del home other user...... ##删除其他用户
Are you sure to do that(Y/n)
13. Going to drop mem_caches...... ##删除内存缓存
Are you sure to do that(Y/n)
14. Going to install pptpd...... ##安装pptpd服务
Are you sure to do that(Y/n)
15. Going to install telnet...... ##安装telnet服务
Are you sure to do that(Y/n)
16. clean this optimization_init...... ##删除
Are you sure to do that(Y/n)
第11项一直回车就行
setup 设置开机启动项
(crond,cups,iptables,network,rsyslog,telnet,sshd,zebra,xinetd)
需要开启
最后重启设备
下载链接:https://download.csdn.net/download/qq_32860517/20448537
————————————————
版权声明:本文为CSDN博主「qq_32860517」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_32860517/article/details/119058022
这篇关于centos设备性能优化的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-02在 Objective-C 中strong 和 retain有什么区别-icode9专业技术文章分享
- 2024-11-02NSString 中的 hasPrefix 有什么作用-icode9专业技术文章分享
- 2024-11-02在 C 和 Objective-C 中inline的用法是什么-icode9专业技术文章分享
- 2024-11-02文件掩码什么意思?-icode9专业技术文章分享
- 2024-11-02在 Git 提交之前运行 composer cs-fix 命令怎么实现-icode9专业技术文章分享
- 2024-11-02为 Composer 的 cs-fix 命令指定一个目录怎么实现-icode9专业技术文章分享
- 2024-11-02微信公众号开发中怎么获取用户的 unionid-icode9专业技术文章分享
- 2024-11-01lip-sync公司指南:一文读懂主要玩家和技术
- 2024-11-01Anthropic的新RAG方法——提升大型语言模型在特定领域的表现
- 2024-11-01UniApp 中组件的生命周期是多少-icode9专业技术文章分享