MySQL在Linux平台安装前需要做哪些准备
本篇内容介绍了“MySQL在Linux平台安装前需要做哪些准备”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
需要开启slew time。
vi/etc/sysconfig/ntpdOPTIONS="-x-untp:ntp-p/var/run/ntpd.pid"servicentpdrestartchkconfigntpdon
配置NTP服务
#vi/etc/ntp.confserver<NTP_SERVER_ADDR>iburst
停止NTP服务,手动同步时间。
servicentpdstopntpdate-b<NTP_SERVER_ADDR>servicentpdstart
时钟写回主板
hwclock--systohchwclock;date2.2 redhat 7
使用Chrony服务
vi/etc/chrony.confserver<NTP_SERVER_ADDR>iburst
重启时间同步服务:
systemctlrestartchronyd.servicesystemctlenablechronyd.service
查看时间同步源:
chronycsources-v
时钟写回主板
hwclock--systohchwclock;date3. 网络设置
#vi/etc/hosts127.0.0.1localhost<IPADDRESS><hostname>4. 配置Limits
cat>>/etc/security/limits.conf<<EOFmysqlsoftnofile1024mysqlhardnofile65536mysqlsoftnproc4095mysqlhardnproc16384mysqlsoftstack10240mysqlhardstack32768EOFcat>>/etc/security/limits.d/90-nproc.conf<<EOFmysqlsoftnproc4095mysqlhardnproc16384EOF5.禁用防火墙
serviceiptablesstopchkconfigiptablesoffserviceip6tablesstopchkconfigip6tablesoff6. 系统内核参数
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<<EOFfs.file-max=6815744kernel.sem=25032000100128kernel.shmmni=4096kernel.shmall=1073741824kernel.shmmax=4398046511104fs.aio-max-nr=1048576#vm.min_free_kbytes=524288vm.swappiness=5#vm.nr_hugepages=1024#vm.hugetlb_shm_group=2000net.core.rmem_default=262144net.core.rmem_max=4194304net.core.wmem_default=262144net.core.wmem_max=1048576net.ipv4.ip_local_port_range=102465500
使其生效
# sysctl -p
默认128,可以加大至512. 根据需求可不加
#vi/etc/rc.localecho512>/sys/block/sda/queue/nr_requests#chmod+x/etc/rc.local8. 文件系统配置
添加noatime,nodiratime选项 根据需求可不添加
#vi/etc/fstab/dev/mapper/centos-app/appxfsdefaults,noatime,nodiratime00
重新挂载后确认
#mount|grepnoatime/dev/mapper/centos-appon/apptypexfs(rw,noatime,nodiratime,attr2,inode64,noquota)9. 重启系统
reboot
好了 MySQL安装前的准备就到这了,下节为如何安装
“MySQL在Linux平台安装前需要做哪些准备”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。