热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

MySQL集群PerconaXtraDBCluster安装搭建步骤详解

nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd

最近公司某客户要求我们的数据库搭建PXC集群以保证他们的系统高性能和搞稳定性,以后花费了一些时间去搭建和测试,也踩过一些坑,准备分享出来

系统:CentOS6.6
Percona XtraDB Cluster:5.6.26

建议关闭iptables, 4个端口 3306,4444,4567,4568
Percona XtraDB Cluster环境所涉及的端口:

#MySQL实例端口
1. Regular MySQL port, default 3306.

#Percona XtraDB Cluster相互通讯的端口
2. Port for group communication, default 4567. It can be changed by the option:
wsrep_provider_optiOns="gmcast.listen_addr=tcp://0.0.0.0:4010; "

#用于SST传送的端口
3. Port for State Transfer, default 4444. It can be changed by the option:
wsrep_sst_receive_address=10.11.12.205:5555

#用于IST传送的端口
4. Port for Incremental State Transfer, default port for group communication + 1 (4568). It can be changed by the option:
wsrep_provider_optiOns= "ist.recv_addr=10.11.12.206:7777; "

node1 192.168.3.130
node2 192.168.3.129
node3 192.168.3.128

1.安装软件依赖包(添加repl源,再安装依赖,3台server操作一样。)

rpm -ivh http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes socat nc -y

2.安装xtrabackup(PXC同步数据需要用到)

yum install -y http://www.percona.com/downloads/percona-release/RedHat/0.1-3/percona-release-0.1-3.noarch.rpm
yum install -y percona-xtrabackup-24

3.下载安装Percona-XtraDB-Cluster

#安装开发包

yum install -y libaio*
yum groupinstall -y 'Development tools'
yum install -y libssl.so.6
ln -sf /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.6
ln -sf /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.6


wget https://www.percona.com/downloads/Percona-XtraDB-Cluster-56/Percona-XtraDB-Cluster-5.6.26-25.12/binary/tarball/Percona-XtraDB-Cluster-5.6.26-rel74.0-25.12.1.Linux.x86_64.tar.gz
tar zxvf Percona-XtraDB-Cluster-5.6.26-rel74.0-25.12.1.Linux.x86_64.tar.gz
useradd -M -s /sbin/nologin mysql
mkdir -p /usr/local/pxc
mkdir -p /data/pxc/mysql3306/{data,tmp,logs}
mv /data/download/Percona-XtraDB-Cluster-5.6.26-rel74.0-25.12.1.Linux.x86_64/* /usr/local/pxc/
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile
chown -R mysql:mysql /data/pxc/mysql3306/
chown -R mysql:mysql /usr/local/pxc 

修改my.cnf配置文件,注意在[mysqld]段落添加PXC的参数:
vi /etc/my.cnf

 130

 
[client]
port            = 3306
socket            = /data/mysql/mysql3306/tmp/mysql.sock   
  

# The MySQL server
[mysqld]
#########Basic##################
explicit_defaults_for_timestamp=true

port            = 3306  
user        = mysql   
basedir         = /usr/local/mysql  
datadir         = /data/mysql/mysql3306/data   
tmpdir          = /data/mysql/mysql3306/tmp   
pid-file        = /data/mysql/mysql3306/tmp/mysql.pid    
socket            = /data/mysql/mysql3306/tmp/mysql.sock   
#skip-grant-tables  

#character set
character_set_server = utf8


open_files_limit = 65535
back_log = 500
#event_scheduler = ON
#lower_case_table_names=1
skip-external-locking
skip_name_resolve = 1
default-storage-engine = InnoDB


#timeout
wait_timeout=1000
interactive_timeout=1000
connect_timeout = 20


server-id       =1303306  #ip最后一位+端口号= 1003376


#percona 的--recursion-method slavehost模式
#report_host = 10.105.9.115
#report_port = 3306



#plugin
plugin-load="semisync_master.so;semisync_slave.so"


#########error log#############
log-error = /data/mysql/mysql3306/logs/error.log  
log-warnings = 2  

#########general log#############
#general_log=1
#general_log_file=/data/mysql/mysql3306/logs/mysql.log 

#########slow log#############
slow_query_log = 1
long_query_time=1
slow_query_log_file = /data/mysql/mysql3306/logs/mysql.slow   


############# for replication###################

log-bin     = /data/mysql/mysql3306/logs/mysql-bin   
binlog_format = row
max_binlog_size = 500M
binlog_cache_size = 2M
max_binlog_cache_size = 2M
expire-logs-days = 7
slave-net-timeout=30


log_bin_trust_function_creators = 1
log-slave-updates = 1   
skip-slave-start = 1
#read_only =1    #从上设置,5.7是super_read_only

#GTID
gtid-mode = on
binlog_gtid_simple_recovery=1
enforce_gtid_consistency=1

#relay log
relay-log = /data/mysql/mysql3306/logs/mysql-relay  
relay-log-index=/data/mysql/mysql3306/logs/relay-bin.index
max-relay-log-size = 500M


#replication crash safe
sync_master_info = 1
sync_relay_log_info = 1
sync_relay_log = 1
relay_log_recovery = 1
master_info_repository = TABLE
relay_log_info_repository = TABLE

#semisync   动态开启 主从切换的时候用
#rpl_semi_sync_master_enabled = 1
#rpl_semi_sync_master_wait_no_slave = 1
#rpl_semi_sync_master_timeout = 1000
#rpl_semi_sync_slave_enabled = 1
#rpl_semi_sync_master_timeout = 100000000 #不要超时,防止切异步,保证主从数据的完全一致性,默认是10000
#rpl_semi_sync_master_wait_point = 'after_sync' #5.7新增参数 after_sync 5.7增强半同步 after_commit5.6普通半同步
#rpl_semi_sync_master_wait_for_slave_count = 2  #5.7新增参数 等待多少个从库接收到binlog


#ignore
#replicate-ignore-db = 'school','school2'
#replicate-do-db = 'school','school2'

#Multi-threaded Slave
#slave_parallel_workers=16
#slave-parallel-type=LOGICAL_CLOCK
#slave-parallel-type=DATABASE

#replication error
#slave-skip-errors=1007,1051,1062

#######per_thread_buffers#####################
max_connections=1100
max_user_connections=1000
max_connect_errors=1000
#myisam_recover
key_buffer_size = 64M
max_allowed_packet = 16M
#table_cache = 3096
table_open_cache = 6144
table_definition_cache = 4096


read_buffer_size = 1M
join_buffer_size = 128K
read_rnd_buffer_size = 1M

#myisam
sort_buffer_size = 128K
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1


myisam_sort_buffer_size = 32M
tmp_table_size = 32M
max_heap_table_size = 64M
query_cache_type=0
query_cache_size = 0
bulk_insert_buffer_size = 32M

thread_cache_size = 64
#thread_concurrency = 32
thread_stack = 192K


###############InnoDB###########################
innodb_data_home_dir = /data/mysql/mysql3306/data      
innodb_log_group_home_dir = /data/mysql/mysql3306/logs    
innodb_data_file_path = ibdata1:1000M:autoextend

innodb_buffer_pool_size = 1G  #根据内存大小设置

innodb_buffer_pool_instances    = 8
#innodb_additional_mem_pool_size = 16M
innodb_log_file_size = 500M
innodb_log_buffer_size = 16M
innodb_log_files_in_group = 3
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
innodb_lock_wait_timeout = 10
innodb_sync_spin_loops = 40
innodb_max_dirty_pages_pct = 80
innodb_support_xa = 1
innodb_thread_concurrency = 0
innodb_thread_sleep_delay = 500
innodb_concurrency_tickets = 1000
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_read_io_threads = 16
innodb_write_io_threads = 16
innodb_io_capacity = 800  #机械盘800 ssd 2000
innodb_flush_neighbors = 1
innodb_file_format = Barracuda
innodb_purge_threads=1   #5.6只能有一个,5.7可以设置多个
innodb_purge_batch_size = 32
innodb_old_blocks_pct=75
innodb_change_buffering=all
innodb_stats_on_metadata=OFF
innodb_print_all_deadlocks = 1
#innodb_status_output=1
#innodb_status_output_locks=1
performance_schema=0   #是否打开P_S库进行性能收集
transaction_isolation = READ-COMMITTED
#innodb_force_recovery=0
#innodb_fast_shutdown=1
#innodb_status_file = 1  #实时输出show engine innodb status到innodb_status文件

############# PXC #####################                                                 
innodb_autoinc_lock_mode=2                                                       
wsrep_cluster_name=pxc-dongzheng                                                 
wsrep_provider=/usr/local/mysql/lib/libgalera_smm.so                             
wsrep_cluster_address=gcomm://192.168.3.130,192.168.3.128,192.168.3.129          
wsrep_node_address=192.168.3.130                                                 
wsrep_slave_threads=2                                                            
wsrep_sst_auth=sst:dongzheng                                                     
wsrep_sst_method=xtrabackup-v2                                                   
wsrep_provider_options="debug=1"



[mysqldump]
quick
max_allowed_packet = 128M


[mysql]
no-auto-rehash
max_allowed_packet = 128M
prompt                         = '(product)\u@\h:\p [\d]> '
default_character_set          = utf8


[myisamchk]
key_buffer_size = 64M
sort_buffer_size = 512k
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
#malloc-lib= /usr/local/mysql/lib/mysql/libjemalloc.so
 

129

[client]
port            = 3306
socket            = /data/mysql/mysql3306/tmp/mysql.sock   
  

# The MySQL server
[mysqld]
#########Basic##################
explicit_defaults_for_timestamp=true

port            = 3306  
user           = mysql   
basedir         = /usr/local/mysql  
datadir         = /data/mysql/mysql3306/data   
tmpdir          = /data/mysql/mysql3306/tmp   
pid-file        = /data/mysql/mysql3306/tmp/mysql.pid    
socket            = /data/mysql/mysql3306/tmp/mysql.sock   
#skip-grant-tables  

#character set
character_set_server = utf8


open_files_limit = 65535
back_log = 500
#event_scheduler = ON
#lower_case_table_names=1
skip-external-locking
skip_name_resolve = 1
default-storage-engine = InnoDB


#timeout
wait_timeout=1000
interactive_timeout=1000
connect_timeout = 20


server-id       =1293306  #ip最后一位+端口号= 1003376


#percona 的--recursion-method slavehost模式
#report_host = 10.105.9.115
#report_port = 3306



#plugin
plugin-load="semisync_master.so;semisync_slave.so"


#########error log#############
log-error = /data/mysql/mysql3306/logs/error.log  
log-warnings = 2  

#########general log#############
#general_log=1
#general_log_file=/data/mysql/mysql3306/logs/mysql.log 

#########slow log#############
slow_query_log = 1
long_query_time=1
slow_query_log_file = /data/mysql/mysql3306/logs/mysql.slow   


############# for replication###################

log-bin     = /data/mysql/mysql3306/logs/mysql-bin   
binlog_format = row
max_binlog_size = 500M
binlog_cache_size = 2M
max_binlog_cache_size = 2M
expire-logs-days = 7
slave-net-timeout=30


log_bin_trust_function_creators = 1
log-slave-updates = 1   
skip-slave-start = 1
#read_only =1    #从上设置,5.7是super_read_only

#GTID
gtid-mode = on
binlog_gtid_simple_recovery=1
enforce_gtid_consistency=1

#relay log
relay-log = /data/mysql/mysql3306/logs/mysql-relay  
relay-log-index=/data/mysql/mysql3306/logs/relay-bin.index
max-relay-log-size = 500M


#replication crash safe
sync_master_info = 1
sync_relay_log_info = 1
sync_relay_log = 1
relay_log_recovery = 1
master_info_repository = TABLE
relay_log_info_repository = TABLE

#semisync   动态开启 主从切换的时候用
#rpl_semi_sync_master_enabled = 1
#rpl_semi_sync_master_wait_no_slave = 1
#rpl_semi_sync_master_timeout = 1000
#rpl_semi_sync_slave_enabled = 1
#rpl_semi_sync_master_timeout = 100000000 #不要超时,防止切异步,保证主从数据的完全一致性,默认是10000
#rpl_semi_sync_master_wait_point = 'after_sync' #5.7新增参数 after_sync 5.7增强半同步 after_commit5.6普通半同步
#rpl_semi_sync_master_wait_for_slave_count = 2  #5.7新增参数 等待多少个从库接收到binlog


#ignore
#replicate-ignore-db = 'school','school2'
#replicate-do-db = 'school','school2'

#Multi-threaded Slave
#slave_parallel_workers=16
#slave-parallel-type=LOGICAL_CLOCK
#slave-parallel-type=DATABASE

#replication error
#slave-skip-errors=1007,1051,1062

#######per_thread_buffers#####################
max_connections=1100
max_user_connections=1000
max_connect_errors=1000
#myisam_recover
key_buffer_size = 64M
max_allowed_packet = 16M
#table_cache = 3096
table_open_cache = 6144
table_definition_cache = 4096


read_buffer_size = 1M
join_buffer_size = 128K
read_rnd_buffer_size = 1M

#myisam
sort_buffer_size = 128K
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1


myisam_sort_buffer_size = 32M
tmp_table_size = 32M
max_heap_table_size = 64M
query_cache_type=0
query_cache_size = 0
bulk_insert_buffer_size = 32M

thread_cache_size = 64
#thread_concurrency = 32
thread_stack = 192K


###############InnoDB###########################
innodb_data_home_dir = /data/mysql/mysql3306/data      
innodb_log_group_home_dir = /data/mysql/mysql3306/logs    
innodb_data_file_path = ibdata1:1000M:autoextend

innodb_buffer_pool_size = 1G  #根据内存大小设置

innodb_buffer_pool_instances    = 8
#innodb_additional_mem_pool_size = 16M
innodb_log_file_size = 500M
innodb_log_buffer_size = 16M
innodb_log_files_in_group = 3
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
innodb_lock_wait_timeout = 10
innodb_sync_spin_loops = 40
innodb_max_dirty_pages_pct = 80
innodb_support_xa = 1
innodb_thread_concurrency = 0
innodb_thread_sleep_delay = 500
innodb_concurrency_tickets = 1000
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_read_io_threads = 16
innodb_write_io_threads = 16
innodb_io_capacity = 800  #机械盘800 ssd 2000
innodb_flush_neighbors = 1
innodb_file_format = Barracuda
innodb_purge_threads=1   #5.6只能有一个,5.7可以设置多个
innodb_purge_batch_size = 32
innodb_old_blocks_pct=75
innodb_change_buffering=all
innodb_stats_on_metadata=OFF
innodb_print_all_deadlocks = 1
#innodb_status_output=1
#innodb_status_output_locks=1
performance_schema=0   #是否打开P_S库进行性能收集
transaction_isolation = READ-COMMITTED
#innodb_force_recovery=0
#innodb_fast_shutdown=1
#innodb_status_file = 1  #实时输出show engine innodb status到innodb_status文件

############# PXC #####################                                                 
innodb_autoinc_lock_mode=2                                                      
wsrep_cluster_name=pxc-dongzheng                                                
wsrep_provider=/usr/local/mysql/lib/libgalera_smm.so                            
wsrep_cluster_address=gcomm://192.168.3.130,192.168.3.128,192.168.3.129         
wsrep_node_address=192.168.3.129                                                
wsrep_slave_threads=2                                                           
wsrep_sst_auth=sst:dongzheng                                                    
wsrep_sst_method=xtrabackup-v2                                                  



[mysqldump]
quick
max_allowed_packet = 128M


[mysql]
no-auto-rehash
max_allowed_packet = 128M
prompt                         = '(product)\u@\h:\p [\d]> '
default_character_set          = utf8


[myisamchk]
key_buffer_size = 64M
sort_buffer_size = 512k
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
#malloc-lib= /usr/local/mysql/lib/mysql/libjemalloc.so
View Code

128

[client]
port            = 3306
socket            = /data/mysql/mysql3306/tmp/mysql.sock   
  

# The MySQL server
[mysqld]
#########Basic##################
explicit_defaults_for_timestamp=true

port            = 3306  
user           = mysql   
basedir         = /usr/local/mysql  
datadir         = /data/mysql/mysql3306/data   
tmpdir          = /data/mysql/mysql3306/tmp   
pid-file        = /data/mysql/mysql3306/tmp/mysql.pid    
socket            = /data/mysql/mysql3306/tmp/mysql.sock   
#skip-grant-tables  

#character set
character_set_server = utf8


open_files_limit = 65535
back_log = 500
#event_scheduler = ON
#lower_case_table_names=1
skip-external-locking
skip_name_resolve = 1
default-storage-engine = InnoDB


#timeout
wait_timeout=1000
interactive_timeout=1000
connect_timeout = 20


server-id       =1283306  #ip最后一位+端口号= 1003376


#percona 的--recursion-method slavehost模式
#report_host = 10.105.9.115
#report_port = 3306



#plugin
plugin-load="semisync_master.so;semisync_slave.so"


#########error log#############
log-error = /data/mysql/mysql3306/logs/error.log  
log-warnings = 2  

#########general log#############
#general_log=1
#general_log_file=/data/mysql/mysql3306/logs/mysql.log 

#########slow log#############
slow_query_log = 1
long_query_time=1
slow_query_log_file = /data/mysql/mysql3306/logs/mysql.slow   


############# for replication###################

log-bin     = /data/mysql/mysql3306/logs/mysql-bin   
binlog_format = row
max_binlog_size = 500M
binlog_cache_size = 2M
max_binlog_cache_size = 2M
expire-logs-days = 7
slave-net-timeout=30


log_bin_trust_function_creators = 1
log-slave-updates = 1   
skip-slave-start = 1
#read_only =1    #从上设置,5.7是super_read_only

#GTID
gtid-mode = on
binlog_gtid_simple_recovery=1
enforce_gtid_consistency=1

#relay log
relay-log = /data/mysql/mysql3306/logs/mysql-relay  
relay-log-index=/data/mysql/mysql3306/logs/relay-bin.index
max-relay-log-size = 500M


#replication crash safe
sync_master_info = 1
sync_relay_log_info = 1
sync_relay_log = 1
relay_log_recovery = 1
master_info_repository = TABLE
relay_log_info_repository = TABLE

#semisync   动态开启 主从切换的时候用
#rpl_semi_sync_master_enabled = 1
#rpl_semi_sync_master_wait_no_slave = 1
#rpl_semi_sync_master_timeout = 1000
#rpl_semi_sync_slave_enabled = 1
#rpl_semi_sync_master_timeout = 100000000 #不要超时,防止切异步,保证主从数据的完全一致性,默认是10000
#rpl_semi_sync_master_wait_point = 'after_sync' #5.7新增参数 after_sync 5.7增强半同步 after_commit5.6普通半同步
#rpl_semi_sync_master_wait_for_slave_count = 2  #5.7新增参数 等待多少个从库接收到binlog


#ignore
#replicate-ignore-db = 'school','school2'
#replicate-do-db = 'school','school2'

#Multi-threaded Slave
#slave_parallel_workers=16
#slave-parallel-type=LOGICAL_CLOCK
#slave-parallel-type=DATABASE

#replication error
#slave-skip-errors=1007,1051,1062

#######per_thread_buffers#####################
max_connections=1100
max_user_connections=1000
max_connect_errors=1000
#myisam_recover
key_buffer_size = 64M
max_allowed_packet = 16M
#table_cache = 3096
table_open_cache = 6144
table_definition_cache = 4096


read_buffer_size = 1M
join_buffer_size = 128K
read_rnd_buffer_size = 1M

#myisam
sort_buffer_size = 128K
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1


myisam_sort_buffer_size = 32M
tmp_table_size = 32M
max_heap_table_size = 64M
query_cache_type=0
query_cache_size = 0
bulk_insert_buffer_size = 32M

thread_cache_size = 64
#thread_concurrency = 32
thread_stack = 192K


###############InnoDB###########################
innodb_data_home_dir = /data/mysql/mysql3306/data      
innodb_log_group_home_dir = /data/mysql/mysql3306/logs    
innodb_data_file_path = ibdata1:1000M:autoextend

innodb_buffer_pool_size = 1G  #根据内存大小设置

innodb_buffer_pool_instances    = 8
#innodb_additional_mem_pool_size = 16M
innodb_log_file_size = 500M
innodb_log_buffer_size = 16M
innodb_log_files_in_group = 3
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
innodb_lock_wait_timeout = 10
innodb_sync_spin_loops = 40
innodb_max_dirty_pages_pct = 80
innodb_support_xa = 1
innodb_thread_concurrency = 0
innodb_thread_sleep_delay = 500
innodb_concurrency_tickets = 1000
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_read_io_threads = 16
innodb_write_io_threads = 16
innodb_io_capacity = 800  #机械盘800 ssd 2000
innodb_flush_neighbors = 1
innodb_file_format = Barracuda
innodb_purge_threads=1   #5.6只能有一个,5.7可以设置多个
innodb_purge_batch_size = 32
innodb_old_blocks_pct=75
innodb_change_buffering=all
innodb_stats_on_metadata=OFF
innodb_print_all_deadlocks = 1
#innodb_status_output=1
#innodb_status_output_locks=1
performance_schema=0   #是否打开P_S库进行性能收集
transaction_isolation = READ-COMMITTED
#innodb_force_recovery=0
#innodb_fast_shutdown=1
#innodb_status_file = 1  #实时输出show engine innodb status到innodb_status文件

############# PXC #####################                                                 
innodb_autoinc_lock_mode=2                                                       
wsrep_cluster_name=pxc-dongzheng                                                 
wsrep_provider=/usr/local/mysql/lib/libgalera_smm.so                             
wsrep_cluster_address=gcomm://192.168.3.130,192.168.3.128,192.168.3.129          
wsrep_node_address=192.168.3.128                                                 
wsrep_slave_threads=2                                                            
wsrep_sst_auth=sst:dongzheng                                                     
wsrep_sst_method=xtrabackup-v2                                                   
wsrep_provider_options="debug=1;socket.checksum=1"


[mysqldump]
quick
max_allowed_packet = 128M


[mysql]
no-auto-rehash
max_allowed_packet = 128M
prompt                         = '(product)\u@\h:\p [\d]> '
default_character_set          = utf8


[myisamchk]
key_buffer_size = 64M
sort_buffer_size = 512k
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
#malloc-lib= /usr/local/mysql/lib/mysql/libjemalloc.so
View Code
cd /usr/local/pxc/
./scripts/mysql_install_db --defaults-file=/etc/my.cnf

看到两次ok

#修改启动脚本
vi /etc/init.d/mysql

basedir=/usr/local/pxc
datadir=/data/pxc/mysql3306/data

4.启动,进行授权操作,对于第一个节点必须以特殊方式启动,如下:

/etc/init.d/mysql --help
Usage: mysql {start|stop|restart|restart-bootstrap|reload|force-reload|status|bootstrap-pxc} [ MySQL (Percona XtraDB Cluster) options ]

第一个节点启动

/etc/init.d/mysql bootstrap-pxc 

5.安全加固
连接mysql:mysql -uroot -p -S /data/mysql/mysql3306/tmp/mysql.sock
delete from mysql.user where user!='root' or host!='localhost';
truncate table mysql.db;
drop database test;
进行授权,这里用户名密码是my.cnf里定义的用户名sst 密码dongzheng
GRANT ALL PRIVILEGES ON *.* TO 'sst'@'%' identified by 'dongzheng';
use mysql;
UPDATE user SET password=PASSWORD('123456') WHERE user='root';
flush privileges;
PXC状态确认
show global status like 'wsrep%';


6.netstat进行查看,可以发现启动两个端口
netstat -lntp | grep mysql
tcp 0 0 0.0.0.0:4567 0.0.0.0:* LISTEN 2964/mysqld
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2964/mysqld

更多详情见请继续阅读下一页的精彩内容: 2017-05/143501p2.htm


推荐阅读
  • 数字图书馆近期展出了一批精选的Linux经典著作,这些书籍虽然部分较为陈旧,但依然具有重要的参考价值。如需转载相关内容,请务必注明来源:小文论坛(http://www.xiaowenbbs.com)。 ... [详细]
  • ButterKnife 是一款用于 Android 开发的注解库,主要用于简化视图和事件绑定。本文详细介绍了 ButterKnife 的基础用法,包括如何通过注解实现字段和方法的绑定,以及在实际项目中的应用示例。此外,文章还提到了截至 2016 年 4 月 29 日,ButterKnife 的最新版本为 8.0.1,为开发者提供了最新的功能和性能优化。 ... [详细]
  • 在 CentOS 6.5 系统上部署 VNC 服务器的详细步骤与配置指南
    在 CentOS 6.5 系统上部署 VNC 服务器时,首先需要确认 VNC 服务是否已安装。通常情况下,VNC 服务默认未安装。可以通过运行特定的查询命令来检查其安装状态。如果查询结果为空,则表明 VNC 服务尚未安装,需进行手动安装。此外,建议在安装前确保系统的软件包管理器已更新至最新版本,以避免兼容性问题。 ... [详细]
  • MySQL 8.0 MGR 自动化部署与配置:DBA 和开源工具的高效解决方案
    MySQL 8.0 MGR 自动化部署与配置:DBA 和开源工具的高效解决方案 ... [详细]
  • 在 Kubernetes 中,Pod 的调度通常由集群的自动调度策略决定,这些策略主要关注资源充足性和负载均衡。然而,在某些场景下,用户可能需要更精细地控制 Pod 的调度行为,例如将特定的服务(如 GitLab)部署到特定节点上,以提高性能或满足特定需求。本文深入解析了 Kubernetes 的亲和性调度机制,并探讨了多种优化策略,帮助用户实现更高效、更灵活的资源管理。 ... [详细]
  • CAS 机制下的无锁队列设计与实现 ... [详细]
  • 2016-2017学年《网络安全实战》第三次作业
    2016-2017学年《网络安全实战》第三次作业总结了教材中关于网络信息收集技术的内容。本章主要探讨了网络踩点、网络扫描和网络查点三个关键步骤。其中,网络踩点旨在通过公开渠道收集目标信息,为后续的安全测试奠定基础,而不涉及实际的入侵行为。 ... [详细]
  • 在过去,我曾使用过自建MySQL服务器中的MyISAM和InnoDB存储引擎(也曾尝试过Memory引擎)。今年初,我开始转向阿里云的关系型数据库服务,并深入研究了其高效的压缩存储引擎TokuDB。TokuDB在数据压缩和处理大规模数据集方面表现出色,显著提升了存储效率和查询性能。通过实际应用,我发现TokuDB不仅能够有效减少存储成本,还能显著提高数据处理速度,特别适用于高并发和大数据量的场景。 ... [详细]
  • 本文详细介绍了在Linux系统上编译安装MySQL 5.5源码的步骤。首先,通过Yum安装必要的依赖软件包,如GCC、GCC-C++等,确保编译环境的完备。接着,下载并解压MySQL 5.5的源码包,配置编译选项,进行编译和安装。最后,完成安装后,进行基本的配置和启动测试,确保MySQL服务正常运行。 ... [详细]
  • 为了优化用户体验,本文探讨了如何调整下拉菜单的宽度。通过合理设置宽度,可以提升界面的美观性和易用性。文章提供了具体的代码示例,帮助开发者实现这一目标。例如,可以通过 CSS 或 JavaScript 来动态调整下拉菜单的宽度,确保其在不同设备和屏幕尺寸上都能保持良好的显示效果。 ... [详细]
  • 分享一款基于Java开发的经典贪吃蛇游戏实现
    本文介绍了一款使用Java语言开发的经典贪吃蛇游戏的实现。游戏主要由两个核心类组成:`GameFrame` 和 `GamePanel`。`GameFrame` 类负责设置游戏窗口的标题、关闭按钮以及是否允许调整窗口大小,并初始化数据模型以支持绘制操作。`GamePanel` 类则负责管理游戏中的蛇和苹果的逻辑与渲染,确保游戏的流畅运行和良好的用户体验。 ... [详细]
  • C++ 开发实战:实用技巧与经验分享
    C++ 开发实战:实用技巧与经验分享 ... [详细]
  • 在使用SSH框架进行项目开发时,经常会遇到一些常见的问题。例如,在Spring配置文件中配置AOP事务声明后,进行单元测试时可能会出现“No Hibernate Session bound to thread”的错误。本文将详细探讨这一问题的原因,并提供有效的解决方案,帮助开发者顺利解决此类问题。 ... [详细]
  • 本文详细介绍了Oracle数据库中的表空间及其分区技术。表空间作为Oracle数据库的一个逻辑单元,每个数据库可包含一个或多个表空间,每个表空间则关联一个或多个数据文件。通过合理的表空间管理和分区策略,可以显著提升数据库的性能和管理效率。文章还总结了实际应用中的最佳实践,为读者提供了宝贵的参考。 ... [详细]
  • 在处理遗留数据库的映射时,反向工程是一个重要的初始步骤。由于实体模式已经在数据库系统中存在,Hibernate 提供了自动化工具来简化这一过程,帮助开发人员快速生成持久化类和映射文件。通过反向工程,可以显著提高开发效率并减少手动配置的错误。此外,该工具还支持对现有数据库结构进行分析,自动生成符合 Hibernate 规范的配置文件,从而加速项目的启动和开发周期。 ... [详细]
author-avatar
ougq
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有