MySQL-5.6+MySQL-Proxy构建主从复制与读写分离(一)

2014-11-24 17:24:55 · 作者: · 浏览: 0

环境:


MySQL-master


IP:192.168.1.10


MySQL-slave


IP:192.168.1.11


Proxry


IP:192.167.1.12


——安装MySQL


1)创建mysql用户


[root@mater ~]# mysql -M -s /sbin/nologin mysql



2)安装软件所需依赖包


[root@master ~]# yum install gcc gcc-c++ autoconf automake ncurses-devel libtool-ltdl-devel* libaio libaio-devel -y


3)解压安装MySQL [这里下载的是免安装版本]


[root@master linux]# tar fzvx mysql-5.6.16-linux-x86_64.tar.gz -C /usr/local/


[root@master linux]# mv mysql-5.6.16-linux-x86_64 mysql


[root@master local]# cd mysql/


[root@master mysql]# chown -R root:mysql .


[root@master mysql]# chown -R mysql:mysql data/


[root@master mysql]# ./scripts/mysql_install_db --user=mysql \


> --basedir=/usr/local/mysql/ \


> --datadir=/usr/local/mysql/data/


WARNING: The host 'master' could not be looked up with /usr/local/mysql//bin/resolveip.


This probably means that your libc libraries are not 100 % compatible


with this binary MySQL version. The MySQL daemon, mysqld, should work


normally with the exception that host name resolving will not work.


This means that you should use IP addresses instead of hostnames


when specifying MySQL privileges !


Installing MySQL system tables...2014-04-26 19:57:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).


2014-04-26 19:57:06 1258 [Note] InnoDB: Using atomics to ref count buffer pool pages


2014-04-26 19:57:06 1258 [Note] InnoDB: The InnoDB memory heap is disabled


2014-04-26 19:57:06 1258 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins


2014-04-26 19:57:06 1258 [Note] InnoDB: Compressed tables use zlib 1.2.3


2014-04-26 19:57:06 1258 [Note] InnoDB: Using Linux native AIO


2014-04-26 19:57:06 1258 [Note] InnoDB: Using CPU crc32 instructions


2014-04-26 19:57:06 1258 [Note] InnoDB: Initializing buffer pool, size = 128.0M


2014-04-26 19:57:07 1258 [Note] InnoDB: Completed initialization of buffer pool


2014-04-26 19:57:07 1258 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!


2014-04-26 19:57:07 1258 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB


2014-04-26 19:57:07 1258 [Note] InnoDB: Database physically writes the file full: wait...


2014-04-26 19:57:07 1258 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB


2014-04-26 19:57:11 1258 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB


2014-04-26 19:57:15 1258 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0


2014-04-26 19:57:15 1258 [Warning] InnoDB: New log files created, LSN=45781


2014-04-26 19:57:15 1258 [Note] InnoDB: Doublewrite buffer not found: creating new


2014-04-26 19:57:15 1258 [Note] InnoDB: Doublewrite buffer created


2014-04-26 19:57:15 1258 [Note] InnoDB: 128 rollback segment(s) are active.


2014-04-26 19:57:15 1258 [Warning] InnoDB: Creating foreign key constraint system tables.


2014-04-26 19:57:16 1258 [Note] InnoDB: Foreign key constraint system tables created


2014-04-26 19:57:16 1258 [Note] InnoDB: Creating tablespace and datafile system tables.


2014-04-26 19:57:16 1258 [Note] InnoDB: Tablespace and datafile system tables created.


2014-04-26 19:57:16 1258 [Note] InnoDB: Waiting for purge to start


2014-04-26 19:57:16 1258 [Note] InnoDB: 5.6.16 started; log sequence number 0


2014-04-26 19:57:16 1258 [Note] RSA private key file not found: /usr/local/mysql/data//private_key.pem. Some authentication plugins will not work.


2014-04-26 19:57:16 1258 [Note]