docker實(shí)戰(zhàn)(一):centos7 yum安裝docker
docker實(shí)戰(zhàn)(二):基礎(chǔ)命令篇
docker實(shí)戰(zhàn)(三):docker網(wǎng)絡(luò)模式(超詳細(xì))
docker實(shí)戰(zhàn)(四):docker架構(gòu)原理
docker實(shí)戰(zhàn)(五):docker鏡像及倉庫配置
docker實(shí)戰(zhàn)(六):docker 網(wǎng)絡(luò)及數(shù)據(jù)卷設(shè)置
docker實(shí)戰(zhàn)(七):docker 性質(zhì)及版本選擇
認(rèn)知升維: 道、法、術(shù)、器、勢(shì)
多臺(tái)服務(wù)器間免密登錄|免密拷貝
Cenos7 搭建Minio集群部署服務(wù)器(一)
Cenos7 搭建Minio集群Nginx統(tǒng)一訪問入口|反向動(dòng)態(tài)代理(二)?
Spring Boot 與Minio整合實(shí)現(xiàn)文件上傳與下載(三)?
CentOS7的journalctl日志查看方法
MySQL8.xx一主兩從復(fù)制安裝與配置
MySQL8.0.30執(zhí)行語句異常:1055 - Expression
MySQL8.0.30一主兩從復(fù)制與配置(一)
MySQL8.XX隨未生成隨機(jī)密碼解決方案
Mysql的主從復(fù)制中主要有三個(gè)線程:
master(binlog dump thread)、slave(I/O thread 、SQL thread),Master一條線程和Slave中的兩條線程。
master(binlog dump thread)主要負(fù)責(zé)Master庫中有數(shù)據(jù)更新的時(shí)候,會(huì)按照binlog格式,將更新的事件類型寫入到主庫的
binlog文件中。并且,Master會(huì)創(chuàng)建log dump線程通知Slave主庫中存在數(shù)據(jù)更新,這就是為什么主庫的binlog日志一定要開啟的原因。
I/O thread線程在Slave中創(chuàng)建,該線程用于請(qǐng)求Master,Master會(huì)返回binlog的名稱以及當(dāng)前數(shù)據(jù)更新的位置、binlog文件位置的副本。
然后,將binlog保存在 「relay log(中繼日志)」 中,中繼日志也是記錄數(shù)據(jù)更新的信息。
SQL線程也是在Slave中創(chuàng)建的,當(dāng)Slave檢測(cè)到中繼日志有更新,就會(huì)將更新的內(nèi)容同步到Slave數(shù)據(jù)庫中,這樣就保證了主從的數(shù)據(jù)的同步。
以上就是主從復(fù)制的過程,當(dāng)然,主從復(fù)制的過程有不同的策略方式進(jìn)行數(shù)據(jù)的同步,主要包含以下幾種:
「同步策略」:Master會(huì)等待所有的Slave都回應(yīng)后才會(huì)提交,這個(gè)主從的同步的性能會(huì)嚴(yán)重的影響。
「半同步策略」:Master至少會(huì)等待一個(gè)Slave回應(yīng)后提交。
「異步策略」:Master不用等待Slave回應(yīng)就可以提交。
「延遲策略」:Slave要落后于Master指定的時(shí)間。
搭建環(huán)境:?
查看系統(tǒng)版本
cat /etc/redhat-release
[root@www tools]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
查看內(nèi)核版本
cat /proc/version
目標(biāo): 一主兩從
? ? ? 主機(jī)IP | 主機(jī)名稱 | ? ?端口 | ? ? ? ? ? ? ??搭建環(huán)境 | ? ? 安裝目錄|節(jié)點(diǎn)類型 |
192.168.1.100 | ?docker0 | ? 3306 | CentOS Linux release 7.9.2009? | /usr/local/mysql8? | master |
192.168.1.101 | ?docker1 | ? ?3306 | CentOS Linux release 7.9.2009? | /usr/local/mysql8? | slave |
192.168.1.102 | ?docker2 | ? ?3306 | CentOS Linux release 7.9.2009? | /usr/local/mysql8? | slave |
檢查MariaDB并移除:
[root@www etc]# rpm -qa | grep mariadb.*
mariadb-libs-5.5.68-1.el7.x86_64
[root@www etc]# yum remove mariadb-libs-5.5.68-1.el7.x86_64 ?-y
?一: 下載對(duì)應(yīng)的版本:
[root@www tools]#
wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz
[root@www tools]# mkdir -p /usr/local/mysql8
1.1解壓過程也分為兩層:
[root@www tools]# tar ?-xvf mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz?
或者??
xz -d mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz?
或者?
tar? -xvf?mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz
之后就會(huì)出現(xiàn)mysql-8.0.30-linux-glibc2.12-x86_64.tar文件;然后tar xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar即可完成解壓
解壓?mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz 至?/usr/local/mysql8
[root@www tools]# tar xvf mysql-8.0.30-linux-glibc2.12-x86_64.tar ?-C /usr/local/mysql8/
1.2重新命名:
? ?[root@www mysql8]# mv mysql-8.0.30-linux-glibc2.12-x86_64 mysql-8.0.30
1.3創(chuàng)建mysql組和mysql用戶
? ?[root@www mysql8]# groupadd mysql
? ?[root@www mysql8]# useradd -r -g mysql mysql
1.4創(chuàng)建軟連接實(shí)現(xiàn)可直接命令行執(zhí)行mysql
[root@www bin]# ln -s /usr/local/mysql8/mysql-8.0.30/bin/mysql /usr/bin
或:
將命令加入環(huán)境變量
#vim /etc/profile
MYSQL_HOME=/usr/local/mysql8/mysql-8.0.30
export PATH=$MYSQL_HOME/bin:$PATH
# source /etc/profile
1.5創(chuàng)建mysql工作目錄
[root@www bin]# mkdir -p /usr/local/mysql8/mysql-8.0.30/data
[root@www bin]# mkdir -p /usr/local/mysql8/mysql-8.0.30/log
[root@www bin]# mkdir -p /usr/local/mysql8/mysql-8.0.30/binlog
[root@www bin]# mkdir -p /usr/local/mysql8/mysql-8.0.30/config
[root@www bin]# mkdir -p /usr/local/mysql8/mysql-8.0.30/tmp
1.6賦權(quán)限給相關(guān)目錄|將mysql目錄的權(quán)限授給mysql用戶和mysql組
[root@www msql-8.0.30]# ?chmod -R 777 /usr/local/mysql8
[root@www msql-8.0.30]# chown -R mysql:mysql /usr/local/mysql8
1.7新建配置文件
配置最小初始化內(nèi)容如下:
[root@www log]# cat /etc/my.cnf?
?
[mysql]
# 設(shè)置mysql客戶端默認(rèn)字符集
default-character-set=utf8mb4
[client]
# 設(shè)置mysql客戶端連接服務(wù)端時(shí)默認(rèn)使用的端口
port=3306
default-character-set=utf8mb4
[mysqld]?
#character config
character_set_server=utf8mb4
#設(shè)置端口
port=3306
explicit_defaults_for_timestamp=true
# 允許最大連接數(shù)
max_connections=1000
#設(shè)置mysql安裝目錄
datadir=/usr/local/mysql8/mysql-8.0.30
# 設(shè)置mysql數(shù)據(jù)庫的數(shù)據(jù)的存放目錄
datadir=/usr/local/mysql8/mysql-8.0.30/data
# 允許連接失敗的次數(shù)。這是為了防止有人從該主機(jī)試圖攻擊數(shù)據(jù)庫系統(tǒng)
max_connect_errors=100
# 每次commit 日志緩存中的數(shù)據(jù)刷到磁盤中。通常設(shè)置為 1,意味著在事務(wù)提交前日志已被寫入磁盤, 事務(wù)可以運(yùn)行更長(zhǎng)以及服務(wù)崩潰后的修復(fù)能力
innodb_flush_log_at_trx_commit=1
# 創(chuàng)建新表時(shí)將使用的默認(rèn)存儲(chǔ)引擎
default-storage-engine=INNODB
# 是否對(duì)sql語句大小寫敏,1表示不敏感 (注意:這個(gè)在mysql8中已經(jīng)無法在配置文件中修改了,只有在初始化的時(shí)候進(jìn)行配置,且如果初始化時(shí)配置了該屬性,則在本配置文件中必須要有該屬性的設(shè)置,否則啟動(dòng)報(bào)錯(cuò)。意思就是要么兩個(gè)地方都配置,要么這里也不要配置。不然迎接你的只有報(bào)錯(cuò))
#lower_case_table_names = 1
#MySQL連接閑置超過一定時(shí)間后(單位:秒)將會(huì)被強(qiáng)行關(guān)閉
#MySQL默認(rèn)的wait_timeout ?值為8個(gè)小時(shí), interactive_timeout參數(shù)需要同時(shí)配置才能生效
interactive_timeout = 1800
wait_timeout = 1800
#Metadata Lock最大時(shí)長(zhǎng)(秒), 一般用于控制 alter操作的最大時(shí)長(zhǎng)sine mysql5.6
#執(zhí)行 DML操作時(shí)除了增加innodb事務(wù)鎖外還增加Metadata Lock,其他alter(DDL)session將阻塞
lock_wait_timeout = 3600
#內(nèi)部?jī)?nèi)存臨時(shí)表的最大值。
#比如大數(shù)據(jù)量的group by ,order by時(shí)可能用到臨時(shí)表,
#超過了這個(gè)值將寫入磁盤,避免系統(tǒng)IO壓力增大,默認(rèn)16M
tmp_table_size = 64M
max_heap_table_size = 64M
# 配置密碼插件使用低版本
default_authentication_plugin=mysql_native_password
# pid-file文件配置
pid-file=/usr/local/mysql8/mysql-8.0.30/mysqld.pid
# 配置日志目錄
log_error=/usr/local/mysql8/mysql-8.0.30/log/mysql-error.log
slow_query_log_file=/usr/local/mysql8/mysql-8.0.30/log/mysql-slow.log
# 設(shè)置SQL模式
sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
#不限制導(dǎo)入導(dǎo)出 任意目錄/temp/data/
secure_file_priv='/temp/data'
1.8初始化,并記住隨機(jī)生成的密碼
[root@www bin]# ./mysqld --initialize --console? ? ?這個(gè)等同于下面的第一個(gè)命令
# 數(shù)據(jù)庫初始化-區(qū)分大小寫
./mysqld --user=mysql --basedir=/usr/local/mysql8/mysql-8.0.30 --datadir=/usr/local/mysql8/mysql-8.0.30/data/ --initialize
# 數(shù)據(jù)庫初始化-不區(qū)分大小寫
./mysqld --user=mysql --lower-case-table-names=1 --basedir=/usr/local/mysql8/mysql-8.0.30 --datadir=/usr/local/mysql8/mysql-8.0.30/data/ --initialize
修改SELINUX=disabled
[root@www bin]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# ? ? enforcing - SELinux security policy is enforced.
# ? ? permissive - SELinux prints warnings instead of enforcing.
# ? ? disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# ? ? targeted - Targeted processes are protected,
# ? ? minimum - Modification of targeted policy. Only selected processes are protected.?
# ? ? mls - Multi Level Security protection.
SELINUXTYPE=targeted?
1.9添加開機(jī)啟動(dòng)mysql服務(wù)和啟動(dòng)mysql服務(wù)?制作啟動(dòng)服務(wù)腳本
[root@www data]# cat /usr/lib/systemd/system/mysql.service
[Unit]
Description=MySQL Server
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
ExecStart=/usr/local/mysql8/mysql-8.0.30/bin/mysqld --defaults-file=/etc/my.cnf
LimitNOFILE = 5000
#Restart=on-failure
#RestartPreventExitStatus=1
#PrivateTmp=false
[root@www data]# systemctl daemon-reload
[root@www data]# systemctl start mysql
[root@www data]# systemctl status mysql
已啟動(dòng),但是有幾個(gè)警告:?
[Warning] [MY-000054]
[Server]
World-writable config file '/usr/local/mysql8/msyql-8.0.30/data/auto.cnf' is ignored.
[Warning] [MY-010107]
[Server]
World-writable config file '/usr/local/mysql8/mysql-8.0.30/data/auto.cnf' has been removed.
大概意思是權(quán)限全局可寫,任何一個(gè)用戶都可以寫。mysql擔(dān)心這種文件被其他用戶惡意修改,所以忽略掉這個(gè)配置文件。導(dǎo)致無法進(jìn)入,這也是mysql的安全機(jī)制之一。所以我們必須得改一些權(quán)限。設(shè)置其他用戶不可寫
[root@www data]# chmod -R 644 /usr/local/mysql8/mysql-8.0.30/data/auto.cnf
重新啟動(dòng):
[root@www data]# systemctl restart mysql
[root@www data]# systemctl status mysql
?上面的警告已解決:
查看下啟動(dòng)日志
[root@www data]# journalctl -xe
2.0使用先前生成的隨機(jī)密碼登錄msql:
[root@www ~]# mysql -u root -p
重置初始密碼, 才能操作數(shù)據(jù)庫相關(guān)命令
mysql> ?set PASSWORD = 'mysql123456'?;
2.1開啟mysql的遠(yuǎn)程訪問權(quán)限
mysql> create user 'root'@'%' identified by 'mysql123456';
Query OK, 0 rows affected (0.02 sec)
mysql> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.01 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> ?select host,user,plugin,authentication_string from user;
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
| host ? ? ?| user ? ? ? ? ? ? | plugin ? ? ? ? ? ? ? ?| authentication_string ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
| % ? ? ? ? | root ? ? ? ? ? ? | mysql_native_password | *CAAA3AD851D5FFA9E5BDB96CA06F73633A3BA831 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
| localhost | mysql.infoschema | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.session ? ?| caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.sys ? ? ? ?| caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | root ? ? ? ? ? ? | caching_sha2_password | $A$005$^xy\V ?{<+_"Y=e?? ?>0qt2GXCJXB2wZqdGd4DmBSmUnaK/buocKhiZcurZ158 |
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
5 rows in set (0.00 sec)
客戶端遠(yuǎn)程連接:
拓展:分別執(zhí)行下面的命令:
mysql> ?show variables like '%files%';
mysql> show variables like '%connections%';
mysql> show variables like '%table_open_cache%';
Query OK, 0 rows affected (0.01 sec)
2.2MySQL8.0.30啟動(dòng)警告:
[Warning] [MY-010139] [Server] Changed limits: max_open_files: 5000 (requested 8210)?
[Warning] [MY-010139] [Server] Changed limits: max_open_files: 5000 (requested 8210)
后續(xù)可以真對(duì)這些參數(shù)進(jìn)行調(diào)優(yōu):
繼續(xù)完善my.cnf文件
# 是否對(duì)sql語句大小寫敏感,1表示不敏感 (注意:這個(gè)在mysql8中已經(jīng)無法在配置文件中修改了,只有在初始化的時(shí)候進(jìn)行配置,且如果初始化時(shí)配置了該屬性,則在本配置文件中必須要有該屬性的設(shè)置,否則啟動(dòng)報(bào)錯(cuò)。意思就是要么兩個(gè)地方都配置,要么這里也不要配置。不然迎接你的只有報(bào)錯(cuò))
lower_case_table_names = 1? ? 配置該參數(shù)后,重啟報(bào)錯(cuò),查看日志如下:
看看操作系統(tǒng)的可打開文件句柄:
[root@www ~]# ulimit -n
1024
二 :CentOS7修改單個(gè)進(jìn)程可打開的最大文件句柄數(shù)?
2.1./etc/security/limits.conf中指定的nofile的值,nofile有上限,不是無窮大。nofile由內(nèi)核參數(shù)nr_open定義的. “在2.6.25內(nèi)核之前有個(gè)宏定義,定義了這個(gè)值的最大值,為1024*1024,正好是100萬,而在2.6.25內(nèi)核及其之后,這個(gè)值是可以通過/proc/sys/fs/nr_open來設(shè)置?!?/h4>
2.2.使用cat /proc/sys/fs/nr_open 查看nr_open值,可通過修改/etc/sysctl.conf 修改fs.nr_open值,sysctl -p生效
2.3.fix_max linux內(nèi)核定義的最大file handles(文件句柄數(shù)).nr_open定義是單進(jìn)程最大file-handles,file-handles(即文件句柄) file-max: The value in file-max denotes the maximum number of file- handles that the Linux kernel will allocate. When you get lots of error messages about running out of file handles, you might want to increase this limit
nr_open:
This denotes the maximum number of file-handles a process can
allocate. Default value is 1024*1024 (1048576) which should be
enough for most machines. Actual limit depends on RLIMIT_NOFILE
resource limit.
注:
在centos 5/6 等版本中,資源限制的配置可以在 /etc/security/limits.conf 設(shè)置,針對(duì)root/user等各個(gè)用戶或者*代表所有用戶來設(shè)置。 當(dāng)然,/etc/security/limits.d/ 中可以配置,系統(tǒng)是先加載limits.conf然后按照英文字母順序加載limits.d目錄下的配置文件,后加載配置覆蓋之前的配置。
不過,在CentOS 7 / RHEL 7的系統(tǒng)中,使用Systemd替代了之前的SysV,因此 /etc/security/limits.conf 文件的配置作用域縮小了一些。limits.conf這里的配置,只適用于通過PAM認(rèn)證登錄用戶的資源限制,它對(duì)systemd的service的資源限制不生效。登錄用戶的限制,與上面講的一樣,通過 /etc/security/limits.conf 和 limits.d 來配置即可。
對(duì)于systemd service的資源限制,如何配置呢?
全局的配置,放在文件 /etc/systemd/system.conf 和 /etc/systemd/user.conf。 同時(shí),也會(huì)加載兩個(gè)對(duì)應(yīng)的目錄中的所有.conf文件 /etc/systemd/system.conf.d/*.conf 和 /etc/systemd/user.conf.d/*.conf
其中,system.conf 是系統(tǒng)實(shí)例使用的,user.conf用戶實(shí)例使用的。一般的sevice,使用system.conf中的配置即可。systemd.conf.d/*.conf中配置會(huì)覆蓋system.conf。
注意:修改了system.conf后,需要重啟系統(tǒng)才會(huì)生效。
2.4、如果需要修改 單個(gè)進(jìn)程打開的文件句柄數(shù) 即nofile大于1024*1024,需要修改nr_open,方法如下:
1、使用cat /proc/sys/fs/nr_open查看nr_open值;
[root@localhost ~]# cat /proc/sys/fs/nr_open?
1048576
2、修改nr_open的值為10240000
打開/etc/sysctl.conf,在文件末尾添加fs.nr_open=10240000
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.nr_open=10240000
保存
(注:nr_open的值要小于file—max)
2.3.1、執(zhí)行如下命令,使修改生效
sysctl -p
2.3.2、驗(yàn)證修改是否生效
cat /proc/sys/fs/nr_open
如果結(jié)果為10240000,說明修改生效
2.3.4、修改/etc/systemd/system.conf,主要用于systemd service的資源限制
[root@localhost ~]# vi /etc/systemd/system.conf
# ?This file is part of systemd.
#
# ?systemd is free software; you can redistribute it and/or modify it
# ?under the terms of the GNU Lesser General Public License as published by
# ?the Free Software Foundation; either version 2.1 of the License, or
# ?(at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See systemd-system.conf(5) for details.
[Manager]
#LogLevel=info
#LogTarget=journal-or-kmsg
#LogColor=yes
#LogLocation=no
#DumpCore=yes
#CrashShell=no
#ShowStatus=yes
#CrashChVT=1
#CtrlAltDelBurstAction=reboot-force
#CPUAffinity=1 2
#JoinControllers=cpu,cpuacct net_cls,net_prio
#RuntimeWatchdogSec=0
#ShutdownWatchdogSec=10min
#CapabilityBoundingSet=
#SystemCallArchitectures=
#TimerSlackNSec=
#DefaultTimerAccuracySec=1min
#DefaultStandardOutput=journal
#DefaultStandardError=inherit
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
#DefaultRestartSec=100ms
#DefaultStartLimitInterval=10s
#DefaultStartLimitBurst=5
#DefaultEnvironment=
#DefaultCPUAccounting=no
#DefaultBlockIOAccounting=no
#DefaultMemoryAccounting=no
#DefaultTasksAccounting=no
#DefaultTasksMax=
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
#DefaultLimitSTACK=
#DefaultLimitCORE=
DefaultLimitCORE=infinity
#DefaultLimitRSS=
#DefaultLimitNOFILE=
DefaultLimitNOFILE=10240000
#DefaultLimitAS=
#DefaultLimitNPROC=
DefaultLimitNPROC=10240000
#DefaultLimitMEMLOCK=
#DefaultLimitLOCKS=
#DefaultLimitSIGPENDING=
#DefaultLimitMSGQUEUE=
#DefaultLimitNICE=
#DefaultLimitRTPRIO=
#DefaultLimitRTTIME=
保存
2.3.5、修改/etc/security/limits.conf文件
[root@localhost ~]# vi /etc/security/limits.conf
在文件末尾添加
root ? ? ? ? ? ?soft ? ?fsize ? ? ? ? ? unlimited
root ? ? ? ? ? ?hard ? ?fsize ? ? ? ? ? unlimited
root ? ? ? ? ? ?soft ? ?cpu ? ? ? ? ? ? unlimited
root ? ? ? ? ? ?hard ? ?cpu ? ? ? ? ? ? unlimited
root ? ? ? ? ? ?soft ? ?as ? ? ? ? ? ? ?unlimited
root ? ? ? ? ? ?hard ? ?as ? ? ? ? ? ? ?unlimited
root ? ? ? ? ? ?soft ? ?nofile ? ? ? ? ?10240000
root ? ? ? ? ? ?hard ? ?nofile ? ? ? ? ?10240000
root ? ? ? ? ? ?soft ? ?nproc ? ? ? ? ? 10240000
root ? ? ? ? ? ?hard ? ?nproc ? ? ? ? ? 10240000
保存退出
2.3.6、修改/etc/security/limits.d/20-nproc.conf文件
[root@localhost ~]# vi /etc/security/limits.d/20-nproc.conf?
修改
* ? ? ? ? ?soft ? ?nproc ? ? 4096
為
* ? ? ? ? ?soft ? ?nproc ? ? 10240000
保存。
CentOS7修改單個(gè)進(jìn)程可打開的最大文件句柄數(shù)為10240000完成。
后續(xù)完善一主二從的搭建:.........................................................................................................文章來源:http://www.zghlxwxcb.cn/news/detail-649812.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-649812.html
到了這里,關(guān)于MySQL8.xx一主兩從復(fù)制安裝與配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!