首页 > 系统相关 >centos os初始设置

centos os初始设置

时间:2023-05-05 14:14:56浏览次数:32  
标签:sys centos echo queue etc deadline 初始 os block

echo "192.168.14.141 mysql1" >> /etc/hosts
echo "export LANG=en_US" >> ~/.bash_profile 


资源限制参数
cat >> /etc/security/limits.conf <<EOF
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* soft nofile 65535
* soft stack 65535
* soft stack 65535
EOF
echo "* - nproc 65535" > /etc/security/limits.d/90-nproc.conf
安全策略
selinux 
setenforce 0 
getenforce 
echo "SELINUX=disabled" > /etc/selinux/config
echo "SELINUXTYPE=targeted" >> /etc/selinux/config
cat /etc/selinux/config
setenforce 0

关闭防火墙
service iptables stop 
chkconfig --level 2345 iptables off 
service firewalld stop 
Redirecting to /bin/systemctl stop firewalld.service
chkconfig --level 2345 firewalld off 
Note: Forwarding request to 'systemctl disable firewalld.service'.
systemctl disable firewalld.service
systemctl list-dependencies firewalld

echo "session required pam_limits.so" >> /etc/pam.d/login
vim /etc/default/grub
GRUB_CMDLINE_LINUX="rhgb quiet numa=off"
grub2-mkconfig -o /etc/grub2.cfg 重新生成/etc/grub2.cfg 
grub2-mkconfig -o /etc/grub2-efi.cfg
reboot 
dmesg|grep -i numa

dmesg|grep -i numa
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.81.1.el7.x86_64 root=UUID=839b281c-1683-453e-b28e-ae188dbc4b8e ro rhgb quiet numa=off
[    0.000000] NUMA turned off
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.81.1.el7.x86_64 root=UUID=839b281c-1683-453e-b28e-ae188dbc4b8e ro rhgb quiet numa=off

cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-1160.81.1.el7.x86_64 root=UUID=839b281c-1683-453e-b28e-ae188dbc4b8e ro rhgb quiet numa=off

numa 参考
https://blog.csdn.net/llh931886/article/details/114361256

io调度算法和io优化操作
cat /sys/block/sd*/queue/scheduler
noop [deadline] cfq 
noop [deadline] cfq 
noop [deadline] cfq 


[root@mysql1 ~]# echo 'deadline' > /sys/block/sda/queue/scheduler 
You have new mail in /var/spool/mail/root
[root@mysql1 ~]# cat /sys/block/sd*/queue/scheduler
noop [deadline] cfq 
noop [deadline] cfq 
noop [deadline] cfq 
[root@mysql1 ~]# echo 'noop' > /sys/block/sda/queue/scheduler 
[root@mysql1 ~]# cat /sys/block/sd*/queue/scheduler
[noop] deadline cfq 
noop [deadline] cfq 
noop [deadline] cfq 

--sas/stat
echo "deadline" > /sys/block/sda/queue/scheduler 

--ssd
echo 'NOOP' > /sys/block/sda/queue/scheduler 

减少预读
echo '16' > /sys/block/sda/queue/read_ahead_k
echo '16' > /sys/block/sdb/queue/read_ahead_k
echo '16' > /sys/block/sdc/queue/read_ahead_k

[root@mysql1 ~]# cat /sys/block/sda/queue/nr_requests
128


增大队列
echo '512' > /sys/block/sda/queue/nr_requests
echo '512' > /sys/block/sdb/queue/nr_requests
echo '512' > /sys/block/sdc/queue/nr_requests

vim /etc/rc.local
echo '16' > /sys/block/sda/queue/read_ahead_k
echo '16' > /sys/block/sdb/queue/read_ahead_k
echo '16' > /sys/block/sdc/queue/read_ahead_k
echo '512' > /sys/block/sda/queue/nr_requests
echo '512' > /sys/block/sdb/queue/nr_requests
echo '512' > /sys/block/sdc/queue/nr_requests

chmod +x /etc/rc.local

vim /etc/sysctl.conf
vm.swappiness=10 # 当物理内存剩余10%的时候,使用交换分区
vm.min_free_kbytes=51200

sysctl -p 

 

标签:sys,centos,echo,queue,etc,deadline,初始,os,block
From: https://www.cnblogs.com/lzjloveit/p/17373935.html

相关文章

  • apipost利用预执行脚本生成不同的测试数据
    apipost利用预执行脚本生成随机的测试数据完整流程使用JavaScript编写预执行脚本进入自动化测试功能界面新建自动化测试,添加接口进去配置执行次数和间隔完成简单介绍apipost提供了强大的接口测试功能,方便我们进行接口测试的各种操作具体步骤1.使用JavaScript编写预......
  • Linux Centos7内核升级
    LinuxCentos7内核升级现在主流的centos应该都是centos7了,从centos7.2开始,内核版本为3.10,越往后内核版本越高。高版本的内核修复了许多的低版本内核的bug,因此,系统是需要提高内核版本的,从而提高安全性,稳定性,并增加更多的功能。Linux是支持多版本内核共存的,无非是系统启动的时候应......
  • java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/
    Java使用AES/CBC/PKCS7Padding加解密时会报错,因为原生JDK不支持。1.在jdk中的jre\lib\security修改java.security文件,替换security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider2./jdk/jre/lib/ext下添加jar包bcprov-jdk15on-1.58.jar ......
  • 解决python配置环境变量后cmd窗口无法打开并弹出Microsoft store界面
    前言在一台新的机器上安装python并正确配置环境变量后,本来打算测试一下是否安装成功,结果在cmd窗口输入python执行后,没有出现版本信息,并会弹出Microsoftstore界面。反复检查了一下,环境变量确实已经正确配置了,但还是无法执行。后经查找资料解决了该问题,在此做下记录。......
  • 在vue中使用axios的步骤(保姆级)
    一、基础用法1.安装axiosnpmiaxios2.引入axios//引入axiosimportaxiosfrom'axios'3使用//发起一个post请求axios({method:'post',url:'http://192.168.0.88:8888/api/private/v1/login',data:{username:'admin'......
  • CentOS7yum安装出现/var/run/yum.pid 已被锁定,解决办法
    安装epel扩展源yum-yinstallepel-release提示:[root@masterhome]#yum-yinstallepel-release已加载插件:fastestmirror,langpacks/var/run/yum.pid已被锁定,PID为22410的另一个程序正在运行。Anotherappiscurrentlyholdingtheyumlock;waitingforitto......
  • centos7安装oracle11g11.2.0.4.0
    1,下载oracle11g11.2.0.4.0安装包,解压2,配置安装环境1,下载配置环境文件-------------------------------------------------------------------------------------------------------------------------------------cd/etc/yum.repos.dwgethttp://public-yum.oracle.com/pub......
  • 部署Kubernetes遇到的问题与解决方法(初始化等)
    Kubelet和controlplane版本不对应:[ERRORKubeletVersion]:thekubeletversionishigherthanthecontrolplaneversion.Thisisnotasupportedversionskewandmayleadtoamalfunctionalcluster.Kubeletversion:"1.19.4"Controlplaneversion:&qu......
  • ubuntu18.04 安装docker、mysql、nacos
    一、安装docker1.更新软件源列表sudoapt-getupdate2.安装软件包依赖sudoaptinstallapt-transport-httpsca-certificatescurlsoftware-properties-common3.在系统中添加Docker的官方密钥curl-fsSLhttps://download.docker.com/linux/ubuntu/gpg|sudoapt-ke......
  • FAQ-virtualbox安装centOS7 报错 not syncing fatal exception
    1、假设你的虚拟机的名字为:CentOS7提示:已经建完(未启动)2、在命令行窗户执行:VBoxManagemodifyvmCentOS7--spec-ctrlonVBoxManage命令所在的目录为:c:\ProgramFiles\Oracle\VirtualBox>3、启动CentOS7......