C/C++教程

centos设备性能优化

本文主要是介绍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设备性能优化的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!