D.1 Multi-instance structure
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/94/wKioL1WiVsPyqtLTAAEhvAoH-C4425.jpg "title=" 2.png " alt= "Wkiol1wivspyqtltaaehvaoh-c4425.jpg"/>
D.2 Multi-Instance installationd.2.1Dependency Packages
# yum Install Ncurses-devel-y
# yum Install Libaio-devel-y
d.2.2installation by binary methodMysql
Note: Refer to the section "MySQL Binary package Installation"
Please refer to MySQL Series b------MySQL installation preparation,MySQL Series b------MySQL installation
d.2.3EstablishMysqlAccount Number
# Groupadd MySQL
# useradd-s/sbin/nologin-g Mysql-mmysql
# Note: A brief description of the useradd command parameter
#1 ,-s/sbin/nologin indicates that the user is prohibited from logging in, enhancing security
#2 ,-G specify belongs to MySQL group
#3 ,-m indicates that the user home directory is not created
d.2.4Create a directory
# mkdir-p/data/{3307,3308}/data
Directory parsing:
Total directory of/data instances
/data/3307 Directory of 3307 instances
/data/3308 Directory of 3308 instances
/data/3307/data Data directory for 3307 instances
/data/3308/data Data directory for 3308 instances
Note: Production hardware configuration: MEM 32g, dual Cpu8core, HDD 6*600g SAS 15k/rpm 2-3 instances
d.2.5Initialize
# Cd/mysql/mysql
# Scripts/mysql_install_db--basedir=/mysql--datadir=/data/3307/data--user=mysql
# Scripts/mysql_install_db--basedir=/mysql--datadir=/data/3308/data--user=mysql
D.3 Multi-instance configuration file
1 , 3307 configuration file/data/3307/
[Client]
port=3307
Socket=/data/3307/mysql.sock
Prompt=\\[email protected] \\r:\\m:\\s->
[Mysqld]
Basedir =/mysql
DataDir =/data/3307/data
Port =3307
server_id =2
Socket =/data/3307/mysql.sock
Log-bin=/data/3307/mysql_bin
Binlog_format=mixed
#binlog-do-db=
#binlog-ignore-db=
Long_query_time=1
Relay-log=/data/3307/relay_bin
Relay-log-info-file=/data/3307/relay_log.info
Sql_mode=no_engine_substitution,strict_trans_tables
[Mysqld_safe]
Log-error=/data/3307/mysql_err.log
Pid-file=/data/3307/mysql_pid.pid
2 , 3308 configuration file/data/3308/
[Client]
port=3308
Socket=/data/3308/mysql.sock
Prompt=\\[email protected] \\r:\\m:\\s->
[Mysqld]
Basedir =/mysql
DataDir =/data/3308/data
Port =3308
server_id =3
Socket =/data/3308/mysql.sock
Log-bin=/data/3308/mysql_bin
Binlog_format=mixed
#binlog-do-db=
#binlog-ignore-db=
Long_query_time=1
Relay-log=/data/3308/relay_bin
Relay-log-info-file=/data/3308/relay_log.info
Sql_mode=no_engine_substitution,strict_trans_tables
[Mysqld_safe]
Log-error=/data/3308/mysql_err.log
Pid-file=/data/3308/mysql_pid.pid
This article is from the "Technical Bo" blog, please be sure to keep this source http://hostman.blog.51cto.com/6303208/1673490
MySQL Series d------MySQL multi-instance installation installation