本篇內容介紹了“在Linux平臺安裝前需要做哪些準備”的有關(guān)知識,在實(shí)際案例的操作過(guò)程中,不少人都會(huì )遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學(xué)有所成!
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
需要開(kāi)啟slew time。
vi /etc/sysconfig/ntpd OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid" service ntpd restart chkconfig ntpd on
配置NTP服務(wù)
# vi /etc/ntp.conf server <NTP_SERVER_ADDR> iburst
停止NTP服務(wù),手動(dòng)同步時(shí)間。
service ntpd stop ntpdate -b <NTP_SERVER_ADDR> service ntpd start
時(shí)鐘寫(xiě)回主板
hwclock --systohc hwclock;date
使用Chrony服務(wù)
vi /etc/chrony.conf server <NTP_SERVER_ADDR> iburst
重啟時(shí)間同步服務(wù):
systemctl restart chronyd.service systemctl enable chronyd.service
查看時(shí)間同步源:
chronyc sources -v
時(shí)鐘寫(xiě)回主板
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指的是單個(gè)內存段的最大值,單位為bytes
shmall指的是能使用的最大內存大小,單位為pages,
pages大小可通過(guò) getconf PAGE_SIZE 命令查詢(xún),一般操作系統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安裝前的準備就到這了,下節為如何安裝
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站