percona的安裝涉及到percona server 和 percona cluster,這裡主要講解percona的cluster,我們主要用到的就是percona cluster。
一、安裝
安裝詳情見官網:
二、配置
主要講解我們使用到的配置。
percona1也就是第一台percona的my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=innodb
max_allowed_packet=512m
innodb_log_file_size=256m
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_address=gcomm://
binlog_format=row
innodb_autoinc_lock_mode=2
wsrep_node_address=10.0.0.1
wsrep_node_incoming_address=10.0.0.1
wsrep_sst_receive_address=10.0.0.1
wsrep_sst_method=xtrabackup-v2
wsrep_cluster_name=percona-xtradb-primary
wsrep_node_name=percona-xtradb-node1
wsrep_sst_auth="manager:password"
key_buffer = 16m
thread_stack = 192k
thread_cache_size = 8
myisam-recover = backup
max_connections = 300
query_cache_limit = 1m
query_cache_size = 16m
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes
expire_logs_days = 10
max_binlog_size = 100m
[mysqldump]
quick
quote-names
max_allowed_packet = 16m
[mysql]
[isamchk]
key_buffer = 16m
percona2也就是第一台percona的my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=innodb
max_allowed_packet=512m
innodb_log_file_size=256m
bind-address = 127.0.0.1
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_address=gcomm:
binlog_format=row
innodb_autoinc_lock_mode=2
wsrep_node_address=10.0.0.2
wsrep_node_incoming_address=10.0.0.2
wsrep_sst_receive_address=10.0.0.2
wsrep_sst_method=xtrabackup-v2
wsrep_cluster_name=percona-xtradb-primary
wsrep_node_name=percona-xtradb-node2
wsrep_sst_auth="manage:password"
key_buffer = 16m
thread_stack = 192k
thread_cache_size = 8
myisam-recover = backup
query_cache_limit = 1m
query_cache_size = 16m
general_log_file = /var/log/mysql/mysql.log
general_log = 1
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes
expire_logs_days = 10
max_binlog_size = 100m
[mysqldump]
quick
quote-names
max_allowed_packet = 16m
[mysql]
[isamchk]
key_buffer = 16m
我的環境是在ubuntu14.04上使用repository安裝的。
第一台percona啟動的方法是:
service mysql bootstrap-pxc
重啟:service mysql restart-bootstrap
第二台percona啟動的方法是:
service mysql start
重啟:service mysql restart
裡面有些引數還可以進行優化。
windows Nginx 安裝及配置
到nginx for windows php 其次安裝nginx 預設安裝到c nginx 然後以cgi 模式安裝php 到c php 接下來就是nginx 配置 我的nginx 配置單 php配置http www.tonightdream.com archives 207.html php解壓置c...
BerkeleyDB安裝及配置
安裝過程 環境 kubuntu 7.10 從其oracle公司官網http www.oracle.com technology software products berkeley db index.html獲得其安裝包,當前版本為4.6.21 tar zxfv db 4.x.tgz cd db 4...
BerkeleyDB安裝及配置
安裝過程 環境 kubuntu 7.10 從其oracle公司官網http www.oracle.com technology software products berkeley db index.html獲得其安裝包,當前版本為4.6.21 tar zxfv db 4.x.tgz cd db 4...