本篇内容介绍了“在Linux平台安装前需要做哪些准备”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
需要开启slew time。
vi /etc/sysconfig/ntpd OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid" service ntpd restart chkconfig ntpd on
配置NTP服务
# vi /etc/ntp.conf server <NTP_SERVER_ADDR> iburst
停止NTP服务,手动同步时间。
service ntpd stop ntpdate -b <NTP_SERVER_ADDR> service ntpd start
时钟写回主板
hwclock --systohc hwclock;date
使用Chrony服务
vi /etc/chrony.conf server <NTP_SERVER_ADDR> iburst
重启时间同步服务:
systemctl restart chronyd.service systemctl enable chronyd.service
查看时间同步源:
chronyc sources -v
时钟写回主板
hwclock --systohc hwclock;date
#vi /etc/hosts 127.0.0.1 localhost <IP ADDRESS> <hostname>
cat>>/etc/security/limits.conf<<EOF mysql soft nofile 1024 mysql hard nofile 65536 mysql soft nproc 4095 mysql hard nproc 16384 mysql soft stack 10240 mysql hard stack 32768 EOF cat>>/etc/security/limits.d/90-nproc.conf<<EOF mysql soft nproc 4095 mysql hard nproc 16384 EOF
service iptables stop chkconfig iptables off service ip6tables stop chkconfig ip6tables off
shmmax和shmall的设置
shmmax指的是单个内存段的最大值,单位为bytes
shmall指的是能使用的最大内存大小,单位为pages,
pages大小可通过 getconf PAGE_SIZE 命令查询,一般操作系统page大小为4096 bytes
如操作系统内存为8G,给80%给Oracle使用,则
kernel.shmmax=(8 * 0.8 * 1024 * 1024 * 1024 )=6871947673
kernel.shmall=kernel.shmmax/4096=1677721
如默认值比较大 请保持默认值
cat>>/etc/sysctl.conf<<EOF fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 fs.aio-max-nr = 1048576 # vm.min_free_kbytes = 524288 vm.swappiness= 5 # vm.nr_hugepages =1024 # vm.hugetlb_shm_group = 2000 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 net.ipv4.ip_local_port_range = 1024 65500
使其生效
# sysctl -p
默认128,可以加大至512. 根据需求可不加
# vi /etc/rc.local echo 512 > /sys/block/sda/queue/nr_requests # chmod +x /etc/rc.local
添加noatime,nodiratime选项 根据需求可不添加
# vi /etc/fstab /dev/mapper/centos-app /app xfs defaults,noatime,nodiratime 0 0
重新挂载后确认
# mount|grep noatime /dev/mapper/centos-app on /app type xfs (rw,noatime,nodiratime,attr2,inode64,noquota)
reboot
好了 MySQL安装前的准备就到这了,下节为如何安装
免责声明:本站发布的内容(图片、视频和文字)以原创、来自本网站内容采集于网络互联网转载等其它媒体和分享为主,内容观点不代表本网站立场,如侵犯了原作者的版权,请告知一经查实,将立刻删除涉嫌侵权内容,联系我们QQ:712375056,同时欢迎投稿传递力量。
Copyright © 2009-2022 56dr.com. All Rights Reserved. 特网科技 特网云 版权所有 特网科技 粤ICP备16109289号
域名注册服务机构:阿里云计算有限公司(万网) 域名服务机构:烟台帝思普网络科技有限公司(DNSPod) CDN服务:阿里云计算有限公司 百度云 中国互联网举报中心 增值电信业务经营许可证B2
建议您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流浏览器浏览本网站