91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

MySQL5.7之PXC集群搭建

發布時間:2020-02-27 08:34:46 來源:網絡 閱讀:394 作者:莎吧啦 欄目:MySQL數據庫

新建pxc001服務器
系統:centos7
內存:2G
磁盤:128G
IP地址:192.168.0.201(第一節點)
192.168.0.202
192.168.0.203

#vi /etc/selinux/config
SELINUX=disabled #修改該項為disabled
#執行命令 setenforce 0
#systemctl restart firewalld
開放防火墻這4個端口
firewall-cmd --add-port=4444/tcp --permanent
firewall-cmd --add-port=4567/tcp --permanent
firewall-cmd --add-port=4568/tcp --permanent
firewall-cmd --add-port=3306/tcp --permanent

安裝集群
#yum -y install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
#yum -y update percona-release
#yum -y install Percona-XtraDB-Cluster-57

啟動mysql,并修改密碼

service mysql start

grep 'temporary password' /var/log/mysqld.log

[Note] A temporary password is generated for root@localhost: u8E;M:,p_T&H
#mysql -uroot -pu8E;M:,p_T&H
mysql> update mysql.user set authentication_string=password('BingoData@1024.com') where user='root' and Host = 'localhost';

使用下面方式啟動第一臺機器(201服務器),這臺叫引導節點。
只有這一臺是這樣啟動。別的服務器用service mysql start啟動
#ssh 192.168.0.201
#systemctl start mysql@bootstrap.service
進入mysql
#mysql -uroot -pBingoData@1024.com
#set wsrep_causal_reads =1; 避免各個節點的數據不一致,這種情況需要等待全同步復制 將此文件復制到master1、master2,注意要把 wsrep_node_name 和 wsrep_node_address 改成相應節點的 hostname 和 ip。

創建配置文件中對應的用戶 所有節點的IP都要創建
#mysql -uroot -pBingoData@1024.com
mysql> grant all privileges on . to 'pxcuser'@'%' identified by 'BingoData@1024.com';
報錯如下:
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
解決辦法:
mysql> set password = password('BingoData@1024.com');
mysql> grant all privileges on . to 'pxcuser'@'%' identified by 'BingoData@1024.com';
mysql> grant all privileges on . to 'pxcuser'@'localhost' identified by 'BingoData@1024.com';
mysql> flush privileges;

進入202和203服務器配置
#ssh 192.168.0.203
注意203和202的啟動方式
#service mysql start
創建配置文件中對應的用戶 所有節點的IP都要創建
mysql> grant all privileges on . to 'pxcuser'@'%' identified by 'BingoData@1024.com';
mysql> grant all privileges on . to 'pxcuser'@'localhost' identified by 'BingoData@1024.com';
mysql> flush privileges;

注意:服務的啟動和停止要對應
service mysql stop ------> 啟動時用service mysql start
systemctl stop mysql@bootstrap.service -----> 啟用是用 systemctl start mysql@bootstrap.service

注意避坑:/var/lib/mysql/grastate.dat文件中safe_to_bootstrap為1的服務器是主庫,用主庫的方式啟動!!我們想讓誰做主庫也可以手動設置該服務器,而且三臺集群的uuid也相同才可以啟動。

seqno為-1表示已加入到集群,數據庫關閉后seqno會變。
下面這臺服務器201做主庫啟動后,seqno從4變成了-1,表示已經加入集群。

203服務器做從庫一直無法啟動。
啟動方式是:service mysql start
報錯信息如下#tail -fn 100 /var/log/mysqld.log
2020-01-10T09:25:56.982598Z 0 [Note] WSREP: (32d9017e, 'tcp://0.0.0.0:4567') turning message relay requesting off
2020-01-10T09:26:23.489499Z 0 [Note] WSREP: (32d9017e, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers: tcp://192.168.0.202:4567
2020-01-10T09:26:24.489792Z 0 [Note] WSREP: (32d9017e, 'tcp://0.0.0.0:4567') reconnecting to 30d8eb06 (tcp://192.168.0.202:4567), attempt 0
2020-01-10T09:26:24.494967Z 0 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view (pc.wait_prim_timeout): 110 (Connection timed out)
at gcomm/src/pc.cpp:connect():159
2020-01-10T09:26:24.495007Z 0 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():209: Failed to open backend connection: -110 (Connection timed out)
2020-01-10T09:26:24.495376Z 0 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1514: Failed to open channel 'pxc-cluster-test' at 'gcomm://192.168.0.202,192.168.0.203,192.168.0.201': -110 (Connection timed out)
2020-01-10T09:26:24.495402Z 0 [ERROR] WSREP: gcs connect failed: Connection timed out
2020-01-10T09:26:24.495415Z 0 [ERROR] WSREP: Provider/Node (gcomm://192.168.0.202,192.168.0.203,192.168.0.201) failed to establish connection with cluster (reason: 7)
2020-01-10T09:26:24.495423Z 0 [ERROR] Aborting

解決辦法:把203服務器的grastate.dat文件的uuid修改的和202,201一模一樣就可以啟動了。
safe_to_bootstrap: 設置為0
那么UUID是什么呢?
為什么同一個pxc集群的UUID是相同的呢?

驗證集群:show status like 'wsrep%';

| wsrep_incoming_addresses | 192.168.0.202:3306,192.168.0.203:3306,192.168.0.201:3306 |
| wsrep_cluster_weight | 3 |
| wsrep_desync_count | 0 |
| wsrep_evs_delayed | |
| wsrep_evs_evict_list | |
| wsrep_evs_repl_latency | 0/0/0/0/0 |
| wsrep_evs_state | OPERATIONAL |
| wsrep_gcomm_uuid | e9e76881-338f-11ea-90d6-3b07eeeaf3a4 |
| wsrep_cluster_conf_id | 3 |
| wsrep_cluster_size | 3 |
| wsrep_cluster_state_uuid | 9d5bc8a5-3374-11ea-9aac-b3599f4e37e4 |
| wsrep_cluster_status | Primary |
| wsrep_connected | ON |
| wsrep_local_bf_aborts | 0 |
| wsrep_local_index | 2 |
| wsrep_provider_name | Galera |
| wsrep_provider_vendor | Codership Oy <info@codership.com> |
| wsrep_provider_version | 3.41(rb3295e6) |
| wsrep_ready | ON

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

甘南县| 博湖县| 巴青县| 萍乡市| 庆阳市| 晋中市| 延吉市| 梓潼县| 从化市| 岑溪市| 井冈山市| 荣成市| 宜丰县| 扎兰屯市| 贡山| 莱州市| 奈曼旗| 贵溪市| 喀什市| 霍林郭勒市| 饶河县| 南召县| 吕梁市| 扬州市| 新和县| 丹江口市| 上饶市| 恩施市| 高碑店市| 宜阳县| 谷城县| 绍兴市| 句容市| 华池县| 佛学| 定陶县| 于都县| 永济市| 华池县| 汪清县| 浮山县|