mysql57 193 0xcl_MySQL高可用之PXC安装部署

1 //Let's start the PXC on node zlm3.

2 [root@zlm3 10:00:12 /data/mysql/mysql3308/data]3 #mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf &

4 [1] 4181

5

6 [root@zlm3 10:30:43 /data/mysql/mysql3308/data]7 #ps aux|grepmysqld8 mysql 4181 20.0 16.9 756016 172580 pts/0 Sl 10:30 0:01 mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf9 root 4596 0.0 0.0 112640 960 pts/0 R+ 10:30 0:00 grep --color=auto mysqld10

11 [root@zlm3 10:31:10 /data/mysql/mysql3308/data]12 #tail -1000error.log13 2018-08-07T09:54:08.825870+01:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for moredetails).14 2018-08-07T09:54:08.825960+01:00 0 [Warning] WSREP: Node is running in bootstrap/initialize mode. Disabling pxc_strict_mode checks15 2018-08-07T09:54:08.836945+01:00 0 [Warning] InnoDB: Using innodb_locks_unsafe_for_binlog is DEPRECATED. This option may be removed in future releases. Please use READ COMMITTED transaction isolation level instead; Please refer to http://dev.mysql.com/doc/refman/5.7/en/set-transaction.html

16 100

17 100

18 100

19 100

20 2018-08-07T09:54:27.784997+01:00 0 [Warning] InnoDB: New log files created, LSN=45790

21 2018-08-07T09:54:28.565405+01:00 0[Warning] InnoDB: Creating foreign key constraint system tables.22 2018-08-07T09:54:29.043051+01:00 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 1ca6f9ae-9a17-11e8-9a7c-080027de0e0e.23 2018-08-07T09:54:29.054082+01:00 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed'cannot be opened.24 2018-08-07T09:54:29.471412+01:00 0[Warning] CA certificate ca.pem is self signed.25 2018-08-07T09:54:29.536187+01:00 1 [Note] A temporary password is generated for root@localhost: ,M3=why-ok&d26 2018-08-07T09:55:01.556746+01:00 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.27 2018-08-07T09:55:01.556802+01:00 1 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.28 2018-08-07T09:55:01.556812+01:00 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.29 2018-08-07T09:55:01.556830+01:00 1 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.30 2018-08-07T09:55:01.556837+01:00 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.31 2018-08-07T09:55:01.556847+01:00 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.32 2018-08-07T09:55:01.556920+01:00 1 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.33 2018-08-07T09:55:01.556931+01:00 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.34

35 //The starting mysqld operation begins here.

36 2018-08-07T10:30:43.794296+01:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for moredetails).37 2018-08-07T10:30:43.801975+01:00 0 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.38 2018-08-07T10:30:43.802040+01:00 0 [Note] mysqld (mysqld 5.7.22-22-29.26-log) starting as process 4181...39 2018-08-07T10:30:43.805420+01:00 0 [Note] WSREP: Setting wsrep_ready to false //Not ready.

40 2018-08-07T10:30:43.805476+01:00 0 [Note] WSREP: No pre-stored wsrep-start position found. Skipping position initialization.41 2018-08-07T10:30:43.805486+01:00 0 [Note] WSREP: wsrep_load(): loading provider library '/usr/local/mysql/lib/libgalera_smm.so'

42 2018-08-07T10:30:43.829026+01:00 0 [Note] WSREP: wsrep_load(): Galera 3.26(r) by Codership Oy loaded successfully.43 2018-08-07T10:30:43.829070+01:00 0 [Note] WSREP: CRC-32C: using hardware acceleration.44 2018-08-07T10:30:43.829385+01:00 0 [Warning] WSREP: Could not open state file for reading: '/data/mysql/mysql3308/data//grastate.dat'

45 2018-08-07T10:30:43.829395+01:00 0[Warning] WSREP: No persistent state found. Bootstraping with default state46 2018-08-07T10:30:43.829432+01:00 0 [Note] WSREP: Found saved state: 00000000-0000-0000-0000-000000000000:-1, safe_to_bootstrap: 1

47 2018-08-07T10:30:43.837823+01:00 0 [Note] WSREP: Passing config to GCS: base_dir = /data/mysql/mysql3308/data/; base_host = 192.168.1.102; base_port = 4567; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 10; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = 4; evs.view_forget_timeout = PT24H; gcache.dir = /data/mysql/mysql3308/data/; gcache.freeze_purge_at_seqno = -1; gcache.keep_pages_count = 0; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /data/mysql/mysql3308/data//galera.cache; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1; gcs.fc_limit = 100; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.segment = 0; gmcast.version = 0; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.npvo = false; pc.recovery = 1; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 8; socket.checksum = 2; socket.recv_buf_size = 212992;

48 2018-08-07T10:30:43.861834+01:00 0 [Note] WSREP: GCache history reset: 00000000-0000-0000-0000-000000000000:0 -> 00000000-0000-0000-0000-000000000000:-1

49 2018-08-07T10:30:43.866886+01:00 0 [Note] WSREP: Assign initial position for certification: -1, protocol version: -1

50 2018-08-07T10:30:43.866919+01:00 0 [Note] WSREP: Preparing to initiate SST/IST //Begin to SST or IST.

51 2018-08-07T10:30:43.866922+01:00 0[Note] WSREP: Starting replication52 2018-08-07T10:30:43.866936+01:00 0 [Note] WSREP: Setting initial position to 00000000-0000-0000-0000-000000000000:-1

53 2018-08-07T10:30:43.867102+01:00 0 [Note] WSREP: Using CRC-32C formessage checksums.54 2018-08-07T10:30:43.867166+01:00 0 [Note] WSREP: gcomm thread scheduling priority set to other:0

55 2018-08-07T10:30:43.869814+01:00 0 [Warning] WSREP: Fail to access the file (/data/mysql/mysql3308/data//gvwstate.dat) error (No such file or directory). It is possible if node is booting for first time or re-booting after a graceful shutdown

56 2018-08-07T10:30:43.869842+01:00 0 [Note] WSREP: Restoring primary-component from disk failed. Either node is booting for first time or re-booting after a graceful shutdown57 2018-08-07T10:30:43.870450+01:00 0 [Note] WSREP: GMCast version 0

58 2018-08-07T10:30:43.870721+01:00 0 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') listening at tcp://0.0.0.0:4567

59 2018-08-07T10:30:43.870729+01:00 0 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') multicast: , ttl: 1

60 2018-08-07T10:30:43.871017+01:00 0 [Note] WSREP: EVS version 0

61 2018-08-07T10:30:43.871191+01:00 0 [Note] WSREP: gcomm: connecting to group 'pxc_wubx', peer '192.168.1.101:,192.168.1.102:,192.168.103:'

62 2018-08-07T10:30:43.873170+01:00 0 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') connection established to 2cf33746 tcp://192.168.1.102:4567

63 2018-08-07T10:30:43.873199+01:00 0 [Warning] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') address 'tcp://192.168.1.102:4567'points to own listening address, blacklisting64 2018-08-07T10:30:43.873754+01:00 0 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') connection established to bd54497d tcp://192.168.1.101:4567

65 2018-08-07T10:30:43.873806+01:00 0 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers:66 2018-08-07T10:30:44.373051+01:00 0 [Note] WSREP: declaring bd54497d at tcp://192.168.1.101:4567 stable

67 2018-08-07T10:30:44.373698+01:00 0[Note] WSREP: Node bd54497d state primary68 2018-08-07T10:30:44.374205+01:00 0[Note] WSREP: Current view of cluster as seen by this node69 view (view_id(PRIM,2cf33746,2)70 memb {71 2cf33746,0 //This is node zlm2,first one started the cluster.

72 bd54497d,0 //This is node zlm3.

73 }74 joined {75 }76 left {77 }78 partitioned {79 }80 )81 2018-08-07T10:30:44.374227+01:00 0 [Note] WSREP: Save the discovered primary-component to disk82 2018-08-07T10:30:44.374354+01:00 0 [Note] WSREP: discarding pending addr without UUID: tcp://192.168.0.103:4567

83 2018-08-07T10:30:44.374361+01:00 0 [Note] WSREP: discarding pending addr proto entry 0x378db50

84 2018-08-07T10:30:44.872036+01:00 0[Note] WSREP: gcomm: connected85 2018-08-07T10:30:44.872107+01:00 0 [Note] WSREP: Shifting CLOSED -> OPEN (TO: 0)86 2018-08-07T10:30:44.872173+01:00 0 [Note] WSREP: Waiting for SST/IST to complete.87 2018-08-07T10:30:44.872327+01:00 0 [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 2

88 2018-08-07T10:30:44.872840+01:00 0 [Note] WSREP: STATE_EXCHANGE: sent state UUID: 2d8c2e2a-9a1c-11e8-8388-a6fcb0b47ae589 2018-08-07T10:30:44.873577+01:00 0 [Note] WSREP: STATE EXCHANGE: sent state msg: 2d8c2e2a-9a1c-11e8-8388-a6fcb0b47ae590 2018-08-07T10:30:44.874140+01:00 0 [Note] WSREP: STATE EXCHANGE: got state msg: 2d8c2e2a-9a1c-11e8-8388-a6fcb0b47ae5 from 0(zlm3)91 2018-08-07T10:30:44.874158+01:00 0 [Note] WSREP: STATE EXCHANGE: got state msg: 2d8c2e2a-9a1c-11e8-8388-a6fcb0b47ae5 from 1(zlm2)92 2018-08-07T10:30:44.874169+01:00 0[Note] WSREP: Quorum results:93 version = 4,94 component =PRIMARY,95 conf_id = 1,96 members = 1/2 (primary/total),97 act_id = 18,98 last_appl. = -1,99 protocols = 0/8/3 (gcs/repl/appl),100 group UUID = bd5525ab-9a15-11e8-aa0f-4b830c783fc7101 2018-08-07T10:30:44.874173+01:00 0 [Note] WSREP: Flow-control interval: [141, 141] //The scope of fc interval.

102 2018-08-07T10:30:44.874176+01:00 0[Note] WSREP: Trying to continue unpaused monitor103 2018-08-07T10:30:44.874179+01:00 0 [Note] WSREP: Shifting OPEN -> PRIMARY (TO: 18)104 2018-08-07T10:30:44.874224+01:00 2[Note] WSREP: State transfer required:105 Group state: bd5525ab-9a15-11e8-aa0f-4b830c783fc7:18

106 Local state: 00000000-0000-0000-0000-000000000000:-1

107 2018-08-07T10:30:44.874231+01:00 2 [Note] WSREP: REPL Protocols: 8 (3, 2)108 2018-08-07T10:30:44.874237+01:00 2 [Note] WSREP: New cluster view: global state: bd5525ab-9a15-11e8-aa0f-4b830c783fc7:18, view# 2: Primary, number of nodes: 2, my index: 0, protocol version 3

109 2018-08-07T10:30:44.874241+01:00 2 [Note] WSREP: Setting wsrep_ready to true

110 2018-08-07T10:30:44.874243+01:00 2 [Warning] WSREP: Gap instate sequence. Need state transfer.111 2018-08-07T10:30:44.874245+01:00 2 [Note] WSREP: Setting wsrep_ready to false

112 2018-08-07T10:30:44.874315+01:00 0 [Note] WSREP: Initiating SST/IST transfer on JOINER side (wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.1.102' --datadir '/data/mysql/mysql3308/data/' --defaults-file '/data/mysql/mysql3308/my3308.cnf' --defaults-group-suffix '' --parent '4181' --binlog '/data/mysql/mysql3308/logs/mysql-bin')113 which: no socat in (/usr/sbin:/sbin:/opt/mysql/Percona-XtraDB-Cluster-5.7.22-rel22-29.26.1.Linux.x86_64.ssl102/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin:/usr/local/zabbix/bin:/usr/local/zabbix/sbin)114 2018-08-07T08:30:45.523175Z WSREP_SST: [ERROR] ******************* FATAL ERROR **********************

115 2018-08-07T08:30:45.524742Z WSREP_SST: [ERROR] socat not found in path: /usr/sbin:/sbin:/opt/mysql/Percona-XtraDB-Cluster-5.7.22-rel22-29.26.1.Linux.x86_64.ssl102/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin:/usr/local/zabbix/bin:/usr/local/zabbix/sbin116 2018-08-07T08:30:45.525848Z WSREP_SST: [ERROR] ******************************************************

117 2018-08-07T10:30:45.526151+01:00 0 [ERROR] WSREP: Failed to read 'ready ' from: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.1.102' --datadir '/data/mysql/mysql3308/data/' --defaults-file '/data/mysql/mysql3308/my3308.cnf' --defaults-group-suffix '' --parent '4181' --binlog '/data/mysql/mysql3308/logs/mysql-bin'

118 Read: '(null)'

119 2018-08-07T10:30:45.526151+01:00 0 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.1.102' --datadir '/data/mysql/mysql3308/data/' --defaults-file '/data/mysql/mysql3308/my3308.cnf' --defaults-group-suffix '' --parent '4181' --binlog '/data/mysql/mysql3308/logs/mysql-bin' : 2 (No such fileor directory)120 2018-08-07T10:30:45.526201+01:00 2 [ERROR] WSREP: Failed to prepare for 'xtrabackup-v2'SST. Unrecoverable.121 2018-08-07T10:30:45.526208+01:00 2[ERROR] Aborting122

123 2018-08-07T10:30:45.526211+01:00 2 [Note] Giving 2client threads a chance to die gracefully124 2018-08-07T10:30:47.373430+01:00 0 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') turning message relay requesting off125 2018-08-07T10:30:47.526391+01:00 2[Note] WSREP: Closing send monitor...126 2018-08-07T10:30:47.526431+01:00 2[Note] WSREP: Closed send monitor.127 2018-08-07T10:30:47.526455+01:00 2[Note] WSREP: gcomm: terminating thread128 2018-08-07T10:30:47.526465+01:00 2[Note] WSREP: gcomm: joining thread129 2018-08-07T10:30:47.526479+01:00 1[Note] WSREP: rollbacker thread exiting130 2018-08-07T10:30:47.526675+01:00 2[Note] WSREP: gcomm: closing backend131 2018-08-07T10:30:50.874663+01:00 2 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') connection to peer bd54497d with addr tcp://192.168.1.101:4567 timed out, no messages seen in PT3S (gmcast.peer_timeout)

132 2018-08-07T10:30:50.874839+01:00 2 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers: tcp://192.168.1.101:4567

133 2018-08-07T10:30:51.877925+01:00 2 [Note] WSREP: (2cf33746, 'tcp://0.0.0.0:4567') reconnecting to bd54497d (tcp://192.168.1.101:4567), attempt 0

134 2018-08-07T10:30:53.026867+01:00 2 [Note] WSREP: declaring node with index 1suspected, timeout PT5S (evs.suspect_timeout)135 2018-08-07T10:30:53.027032+01:00 2 [Note] WSREP: evs::proto(2cf33746, LEAVING, view_id(REG,2cf33746,2)) suspecting node: bd54497d136 2018-08-07T10:30:53.027042+01:00 2 [Note] WSREP: evs::proto(2cf33746, LEAVING, view_id(REG,2cf33746,2)) suspected node without joinmessage, declaring inactive137 2018-08-07T10:30:53.027063+01:00 2[Note] WSREP: Current view of cluster as seen by this node138 view (view_id(NON_PRIM,2cf33746,2)139 memb {140 2cf33746,0 //Only remains the first node zlm2.

141 }142 joined {143 }144 left {145 }146 partitioned {147 bd54497d,0 //Node zlm3 became a suspected node and be moved here.

148 }149 )150 2018-08-07T10:30:53.027092+01:00 2[Note] WSREP: Current view of cluster as seen by this node151 view ((empty))152 2018-08-07T10:30:53.027370+01:00 2[Note] WSREP: gcomm: closed153 2018-08-07T10:30:53.027421+01:00 0 [Note] WSREP: New COMPONENT: primary = no, bootstrap = no, my_idx = 0, memb_num = 1

154 2018-08-07T10:30:53.027435+01:00 0 [Note] WSREP: Flow-control interval: [100, 100]155 2018-08-07T10:30:53.027438+01:00 0[Note] WSREP: Trying to continue unpaused monitor156 2018-08-07T10:30:53.027443+01:00 0 [Note] WSREP: Received NON-PRIMARY.157 2018-08-07T10:30:53.027447+01:00 0 [Note] WSREP: Shifting PRIMARY -> OPEN (TO: 18)158 2018-08-07T10:30:53.027458+01:00 0 [Note] WSREP: Received self-leave message.159 2018-08-07T10:30:53.027463+01:00 0 [Note] WSREP: Flow-control interval: [0, 0]160 2018-08-07T10:30:53.027466+01:00 0[Note] WSREP: Trying to continue unpaused monitor161 2018-08-07T10:30:53.027469+01:00 0 [Note] WSREP: Received SELF-LEAVE. Closing connection.162 2018-08-07T10:30:53.027472+01:00 0 [Note] WSREP: Shifting OPEN -> CLOSED (TO: 18)163 2018-08-07T10:30:53.027477+01:00 0 [Note] WSREP: RECV thread exiting 0: Success164 2018-08-07T10:30:53.027719+01:00 2[Note] WSREP: recv_thread() joined.165 2018-08-07T10:30:53.027732+01:00 2[Note] WSREP: Closing replication queue.166 2018-08-07T10:30:53.027738+01:00 2[Note] WSREP: Closing slave action queue.167 2018-08-07T10:30:53.027796+01:00 0 [Note] WSREP: Waiting foractive wsrep applier to exit168 2018-08-07T10:30:53.027804+01:00 0[Note] WSREP: Service disconnected.169 2018-08-07T10:30:53.027807+01:00 0[Note] WSREP: Waiting to close threads......170 2018-08-07T10:30:58.028048+01:00 0[Note] WSREP: Some threads may fail to exit.171 2018-08-07T10:30:58.028088+01:00 0[Note] Binlog end172 2018-08-07T10:30:58.028341+01:00 0[Note] mysqld: Shutdown complete173

174 [root@zlm3 10:35:04 /data/mysql/mysql3308/data]175 #ps aux|grepmysqld176 root 4672 0.0 0.0 112640 960 pts/0 R+ 10:35 0:00 grep --color=auto mysqld177

178 //Let's see the detail of ERROR message.

179 [root@zlm3 10:35:06 /data/mysql/mysql3308/data]180 #cat error.log |grepERROR181 2018-08-07T08:30:45.523175Z WSREP_SST: [ERROR] ******************* FATAL ERROR **********************

182 2018-08-07T08:30:45.524742Z WSREP_SST: [ERROR] socat not found in path: /usr/sbin:/sbin:/opt/mysql/Percona-XtraDB-Cluster-5.7.22-rel22-29.26.1.Linux.x86_64.ssl102/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin:/usr/local/zabbix/bin:/usr/local/zabbix/sbin183 2018-08-07T08:30:45.525848Z WSREP_SST: [ERROR] ******************************************************

184 2018-08-07T10:30:45.526151+01:00 0 [ERROR] WSREP: Failed to read 'ready ' from: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.1.102' --datadir '/data/mysql/mysql3308/data/' --defaults-file '/data/mysql/mysql3308/my3308.cnf' --defaults-group-suffix '' --parent '4181' --binlog '/data/mysql/mysql3308/logs/mysql-bin'

185 2018-08-07T10:30:45.526151+01:00 0 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.1.102' --datadir '/data/mysql/mysql3308/data/' --defaults-file '/data/mysql/mysql3308/my3308.cnf' --defaults-group-suffix '' --parent '4181' --binlog '/data/mysql/mysql3308/logs/mysql-bin' : 2 (No such fileor directory)186 2018-08-07T10:30:45.526201+01:00 2 [ERROR] WSREP: Failed to prepare for 'xtrabackup-v2'SST. Unrecoverable.187 2018-08-07T10:30:45.526208+01:00 2[ERROR] Aborting188

189 //It says that we are absent of "socat" package.

190

191 [root@zlm3 10:43:15 /data/mysql/mysql3308/data]192 #yum installsocat193 ... //Omitted.

194

195 Warning: RPMDB altered outside of yum.196 Installing : socat-1.7.3.2-2.el7.x86_64 1/1

197 Verifying : socat-1.7.3.2-2.el7.x86_64 1/1

198

199 Installed:200 socat.x86_64 0:1.7.3.2-2.el7201

202 Complete!

203

204 //Start the PXC on zlm2 again.

205 [root@zlm3 10:35:58 /data/mysql/mysql3308/data]206 #mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf &

207 [1] 4725

208

209 [root@zlm3 10:53:02 /data/mysql/mysql3308/data]210 #tail -f error.log211 2018-08-07T10:53:15.116919+01:00 0 [Note] WSREP: Member 0.0 (zlm3) requested state transfer from '*any*'. Selected 1.0(zlm2)(SYNCED) as donor.212 2018-08-07T10:53:15.117004+01:00 0 [Note] WSREP: Shifting PRIMARY -> JOINER (TO: 18)213 2018-08-07T10:53:15.117035+01:00 2 [Note] WSREP: Requesting state transfer: success, donor: 1

214 2018-08-07T10:53:15.117051+01:00 2 [Note] WSREP: GCache history reset: 00000000-0000-0000-0000-000000000000:0 -> bd5525ab-9a15-11e8-aa0f-4b830c783fc7:18

215 2018-08-07T10:53:15.696885+01:00 0 [Warning] WSREP: 1.0 (zlm2): State transfer to 0.0 (zlm3) failed: -2 (No such fileor directory)216 2018-08-07T10:53:15.696918+01:00 0 [ERROR] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():766: Will never receive state. Need to abort.217 2018-08-07T10:53:15.696940+01:00 0[Note] WSREP: gcomm: terminating thread218 2018-08-07T10:53:15.696949+01:00 0[Note] WSREP: gcomm: joining thread219 2018-08-07T10:53:15.697076+01:00 0[Note] WSREP: gcomm: closing backend220 2018-08-07T10:53:17.026257+01:00 0 [Note] WSREP: (5167e9c7, 'tcp://0.0.0.0:4567') turning message relay requesting off221 2018-08-07T10:53:19.026327+01:00 0 [Note] WSREP: (5167e9c7, 'tcp://0.0.0.0:4567') connection to peer bd54497d with addr tcp://192.168.1.101:4567 timed out, no messages seen in PT3S (gmcast.peer_timeout)

222 2018-08-07T10:53:19.026394+01:00 0 [Note] WSREP: (5167e9c7, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers: tcp://192.168.1.101:4567

223 2018-08-07T10:53:20.086590+01:00 0 [Note] WSREP: (5167e9c7, 'tcp://0.0.0.0:4567') reconnecting to bd54497d (tcp://192.168.1.101:4567), attempt 0

224 2018-08-07T10:53:20.786605+01:00 0 [Note] WSREP: declaring node with index 1suspected, timeout PT5S (evs.suspect_timeout)225 2018-08-07T10:53:20.786778+01:00 0 [Note] WSREP: evs::proto(5167e9c7, LEAVING, view_id(REG,5167e9c7,4)) suspecting node: bd54497d226 2018-08-07T10:53:20.786826+01:00 0 [Note] WSREP: evs::proto(5167e9c7, LEAVING, view_id(REG,5167e9c7,4)) suspected node without joinmessage, declaring inactive227 2018-08-07T10:53:20.786941+01:00 0[Note] WSREP: Current view of cluster as seen by this node228 view (view_id(NON_PRIM,5167e9c7,4)229 memb {230 5167e9c7,0

231 }232 joined {233 }234 left {235 }236 partitioned {237 bd54497d,0

238 }239 )240 2018-08-07T10:53:20.787061+01:00 0[Note] WSREP: Current view of cluster as seen by this node241 view ((empty))242 2018-08-07T10:53:20.787324+01:00 0[Note] WSREP: gcomm: closed243 2018-08-07T10:53:20.787362+01:00 0[Note] WSREP: mysqld: Terminated.244 ^C245

246 [root@zlm3 10:53:48 /data/mysql/mysql3308/data]247 #cat error.log |grepERROR248 2018-08-07T10:53:15.696918+01:00 0 [ERROR] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():766: Will never receive state. Need to abort.249

250 [root@zlm3 11:13:14 /data/mysql/mysql3308/data]251 #ps aux|grepmysqld252 root 6785 0.0 0.0 112640 960 pts/0 R+ 11:20 0:00 grep --color=auto mysqld253 [1]+ Aborted mysqld --defaults-file=/data/mysql/mysql3308/my3308.cnf254

255 [root@zlm3 11:20:16 /data/mysql/mysql3308/data]256 #cat error.log |grepERROR257 2018-08-07T11:13:15.619315+01:00 0 [ERROR] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():766: Will never receive state. Need to abort.258 2018-08-07T09:13:45.246252Z WSREP_SST: [ERROR] ******************* FATAL ERROR **********************

259 2018-08-07T09:13:45.247507Z WSREP_SST: [ERROR] Error while getting data from donor node: exit codes: 255 0

260 2018-08-07T09:13:45.254423Z WSREP_SST: [ERROR] ******************************************************

261 2018-08-07T09:13:45.258735Z WSREP_SST: [ERROR] Cleanup after exit with status:32

262 2018-08-07T09:14:10.137993Z WSREP_SST: [ERROR] ******************* FATAL ERROR **********************

263 2018-08-07T09:14:10.139033Z WSREP_SST: [ERROR] Possible timeout in receving first data from donor in gtid/keyring stage264 2018-08-07T09:14:10.140912Z WSREP_SST: [ERROR] ******************************************************

265 2018-08-07T09:14:10.141951Z WSREP_SST: [ERROR] Cleanup after exit with status:32

266

267 //There's still one error which cause the mysqld process cannot be started.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
首先,你需要确保你已经安装MySQL 数据库,并且已经创建了一个数据库和一个用户,同时该用户拥有访问该数据库的权限。 然后,你需要在 IntelliJ IDEA 中进行以下步骤: 1. 在项目的 pom.xml 文件中添加 MySQL 的依赖: ```xml <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.25</version> </dependency> ``` 2. 在 IntelliJ IDEA 中打开项目,然后在项目结构中右键点击项目名称,选择“Open Module Settings”或者按下快捷键 F4。 3. 在弹出的窗口中选择“Libraries”,然后点击“+”按钮添加 MySQL 的 JAR 包。 4. 在项目中创建一个 Java 类,然后在该类中编写连接数据库的代码,示例代码如下: ```java import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { public static void main(String[] args) { String url = "jdbc:mysql://localhost:3306/test_db?serverTimezone=UTC"; String user = "test_user"; String password = "test_password"; try { Connection conn = DriverManager.getConnection(url, user, password); System.out.println("数据库连接成功!"); } catch (SQLException e) { System.out.println("数据库连接失败!"); e.printStackTrace(); } } } ``` 其中,url 参数是数据库的 URL,test_db 是数据库的名称,serverTimezone=UTC 是为了解决时区问题;user 和 password 参数是数据库的用户名和密码。 5. 运行该 Java 类,如果控制台输出“数据库连接成功!”,说明连接成功;如果输出“数据库连接失败!”,则说明连接失败。 以上就是在 IntelliJ IDEA 中连接 MySQL 数据库的步骤。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值