MySQL在Linux平台安装前需要做哪些准备-创新互联

创新互联公司主要从事网站建设、成都网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务西安,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:13518219792

本篇内容介绍了“MySQL在Linux平台安装前需要做哪些准备”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

1. Selinux关闭

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

2. 时间同步

2.1 redhat 5/6

需要开启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           iburst

停止NTP服务,手动同步时间。

service ntpd stop
ntpdate -b 
service ntpd start

时钟写回主板

hwclock --systohc
hwclock;date

2.2 redhat 7

使用Chrony服务

vi /etc/chrony.conf
server           iburst

重启时间同步服务:

systemctl restart chronyd.service
systemctl enable chronyd.service

查看时间同步源:

chronyc sources -v

时钟写回主板

hwclock --systohc
hwclock;date

3. 网络设置

#vi /etc/hosts
127.0.0.1                        localhost
    

4. 配置Limits

cat>>/etc/security/limits.conf<>/etc/security/limits.d/90-nproc.conf<

5.禁用防火墙

service iptables stop
chkconfig iptables off
service ip6tables stop
chkconfig ip6tables off

6. 系统内核参数

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<

使其生效

# sysctl -p

7. 加大磁盘队列深度

默认128,可以加大至512. 根据需求可不加

# vi /etc/rc.local
echo 512 > /sys/block/sda/queue/nr_requests
# chmod +x /etc/rc.local

8. 文件系统配置

添加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)

9. 重启系统

reboot


好了 MySQL安装前的准备就到这了,下节为如何安装

“MySQL在Linux平台安装前需要做哪些准备”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联-成都网站建设公司网站,小编将为大家输出更多高质量的实用文章!


名称栏目:MySQL在Linux平台安装前需要做哪些准备-创新互联
标题来源:http://ybzwz.com/article/pdhod.html