亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 關(guān)于使用google的mysql4.0.26的使用小結(jié) [打印本頁(yè)]

作者: helbreathszw    時(shí)間: 2007-05-11 15:16
標(biāo)題: 關(guān)于使用google的mysql4.0.26的使用小結(jié)
最近因?yàn)榍埔?jiàn)google推出了他們mysql數(shù)據(jù)庫(kù)的,有幾個(gè)特性很不錯(cuò),mirror-binlogs和針對(duì)每個(gè)用戶的
和每個(gè)表的查詢,update統(tǒng)計(jì),于是就開(kāi)始試用。

http://code.google.com/p/google-mysql-tools/wiki/Mysql4Patches
照著說(shuō)明把補(bǔ)丁打好
我偷了個(gè)懶,做了一個(gè)rpm包。這樣只要一次編譯,就能在3臺(tái)測(cè)試機(jī)器上使用了。(做不做rpm包和本次
數(shù)據(jù)庫(kù)安裝并無(wú)多大關(guān)系,只是為了方便。)

弄好之后
找個(gè)測(cè)試環(huán)境
俺找了一臺(tái)3臺(tái)機(jī)器
分別為10.210.128.174 10.210.128.175 10.210.128.176
各自的角色分別為10.210.128.174為主master
10.210.128.175為relay-slave ,就是中繼服務(wù)器,(PS:它是174的slave,卻又是176的master)
10.210.128.176為175的slave。

我們以3318端口為數(shù)據(jù)庫(kù)端口
照著mysql手冊(cè)mysql replicate的安裝,我們可以得到mysql,test 2個(gè)庫(kù)(此處略去300字)
然后在174機(jī)器的/data2/msyql3318/my3318.cnf(新建)
[mysqld]
port                    = 3318
user                    = my3318
datadir                 = /data2/mysql3318
socket                  = /tmp/mysql3318.sock
server-id               = 1281743318
log-bin
long_query_time         = 1
log-slow-queries        = /data2/mysql3318/slow-queries.log


---------------------------------
然后然后通過(guò)/usr/local/bin/mysqld_safe --defaults-file=/data2/mysql3318/my3318.cnf &啟動(dòng)
并在174上進(jìn)行對(duì)175,176的replica帳號(hào)的授權(quán)。(照著mysql官方手冊(cè)的replica授權(quán),此處略200字)
cd /data2/mysql3318
tar zcvf mysql3318.tar.gz mysql test  將mysql,test數(shù)據(jù)打包傳給175,176


--------------
175上將174傳過(guò)來(lái)的mysql3318.tar.gz解壓縮到他自己的/data2/mysql3318目錄下
然后自己編輯175的/data2/mysql3318/my3318.cnf(新建)
內(nèi)容如下
[mysqld]
port                    = 3318
user                    = my3318
datadir                 = /data2/mysql3318
socket                  = /tmp/mysql3318.sock
skip-slave-start
rpl_mirror_binlog_enabled
rpl_mirror_binlog_no_replicate
log-bin-index=mama
log-slave-updates
server-id               = 1281753318
log-bin
long_query_time         = 1
log-slow-queries        = /data2/mysql3318/slow-queries.log
master-host             = 10.210.128.174
master-port             = 3318
master-user             = replica
master-password         = xxxxxxx
master-connect-retry    = 60

然后通過(guò)/usr/local/bin/mysqld_safe --defaults-file=/data2/mysql3318/my3318.cnf &啟動(dòng)
登錄到mysql控制臺(tái)
執(zhí)行change master to 操作  (也是照mysql官方手冊(cè)關(guān)于mysql replicate的一章有詳細(xì)介紹)
見(jiàn)圖 175showslavestatus   ,當(dāng)然數(shù)據(jù)有些出入的,如binlog的pos,還有master_log_file
為了確認(rèn)是否175真的連上了174,可以在174上用show processlist
見(jiàn)圖174showprocesslist
----------------------------------------
接下去我們?cè)?76上進(jìn)行配置
176上將174傳過(guò)來(lái)的mysql3318.tar.gz解壓縮到他自己的/data2/mysql3318目錄下
然后自己編輯176的/data2/mysql3318/my3318.cnf(新建)

[mysqld]
port                    = 3318
user                    = my3318
datadir                 = /data2/mysql3318
socket                  = /tmp/mysql3318.sock
rpl_mirror_binlog_enabled
#rpl_mirror_binlog_no_replicate
log-bin-index=mama
server-id               = 1281763318
log-bin
master-host             = 10.210.128.175
master-port             = 3318
master-user             = replica
master-password         = xxxxxx
master-connect-retry    = 60

--------------------------------

然后通過(guò)/usr/local/bin/mysqld_safe --defaults-file=/data2/mysql3318/my3318.cnf &啟動(dòng)
登錄到mysql控制臺(tái)
執(zhí)行change master to 操作  (也是照mysql官方手冊(cè)關(guān)于mysql replicate的一章有詳細(xì)介紹)
見(jiàn)圖 176showslavestatus   ,當(dāng)然數(shù)據(jù)有些出入的,如binlog的pos,還有master_log_file

都弄好之后
我們?cè)趍aster174上進(jìn)行一個(gè)實(shí)驗(yàn)
use test;
create table zongwen (id int;

圖174createtable
然后俺們瞧瞧
圖175show2
圖176show2
圖176show3

175-showslavestatus.JPG (100.79 KB, 下載次數(shù): 116)

175-showslavestatus.JPG

174-showprocesslist.JPG (82.03 KB, 下載次數(shù): 125)

174-showprocesslist.JPG

作者: helbreathszw    時(shí)間: 2007-05-11 15:17
標(biāo)題: 圖來(lái)
發(fā)圖

175-showslavestatus.JPG (100.79 KB, 下載次數(shù): 115)

175-showslavestatus.JPG

174showtable_statistics.JPG (94.28 KB, 下載次數(shù): 110)

174showtable_statistics.JPG

作者: helbreathszw    時(shí)間: 2007-05-11 15:19
標(biāo)題: 發(fā)圖
發(fā)圖

176showslavestatus.JPG (100.91 KB, 下載次數(shù): 171)

176showslavestatus.JPG

176show2.JPG (100.74 KB, 下載次數(shù): 106)

176show2.JPG

作者: helbreathszw    時(shí)間: 2007-05-11 15:21
標(biāo)題: 發(fā)圖
發(fā)圖

[ 本帖最后由 helbreathszw 于 2007-5-11 15:31 編輯 ]

176show3.JPG (84.83 KB, 下載次數(shù): 111)

176show3.JPG

174createtable.JPG (93.29 KB, 下載次數(shù): 118)

174createtable.JPG

作者: helbreathszw    時(shí)間: 2007-05-11 15:24
附上176的err文件記錄
070511 14:23:07  mysqld started
070511 14:23:07 Read master - info: log_file_name: CentOS4-VM174-bin.002, pos: 867
070511 14:23:07 Replication status inside relay-log.info: relay-log['./CentOS4-VM176-relay-bin.003'(4)], master-log['CentOS4-VM174-bin.002'(867)]
/usr/local/sinasrv/bin/mysqld: ready for connections.
Version: '4.0.26-log'  socket: '/tmp/mysql3318.sock'  port: 3318  Sina.com Network&System Binary Distribution
070511 14:25:02 Slave SQL thread initialized, starting replication in log 'CentOS4-VM174-bin.002' at position 867, relay log './CentOS4-VM176-relay-bin.003' position: 4
070511 14:25:02 Slave I/O thread: connected to master 'replica@10.210.128.175:3318', asynchronous replication started in log 'CentOS4-VM174-bin.002' at position 867
070511 14:25:02 ReplicationMule: RELAY_MATCH_MULE (CentOS4-VM174-bin.002, 867)


附上174的err文件記錄
070511 13:26:44  mysqld started
/usr/local/sinasrv/bin/mysqld: ready for connections.
Version: '4.0.26-log'  socket: '/tmp/mysql3318.sock'  port: 3318  Sina.com Network&System Binary Distribution
070511 13:49:52 Start mirror_binlog_client, asynchronous binlog_dump to slave_server(128175331, pos(CentOS4-VM174-bin.002, 4)

附上175的err記錄
/usr/local/sinasrv/bin/mysqld: ready for connections.
Version: '4.0.26-log'  socket: '/tmp/mysql3318.sock'  port: 3318  Sina.com Network&System Binary Distribution
070511 13:44:48 Slave SQL thread initialized, starting replication in log 'CentOS4-VM174-bin.002' at position 867, relay log './CentOS4-VM175-relay-bin.001' position: 4
070511 13:44:49 Slave I/O thread: connected to master 'replica@10.210.128.174:3318', asynchronous replication started in log 'CentOS4-VM174-bin.002' at position 867
070511 13:44:49 Mule binlog(./CentOS4-VM175-bin.001) does not match new relay-binlog(CentOS4-VM174-bin.002)
070511 13:44:49 Slave I/O thread exiting, read up to log 'CentOS4-VM174-bin.002', position 867
070511 13:49:47 Error reading relay log event: slave SQL thread was killed
070511 13:49:52 Slave SQL thread initialized, starting replication in log 'CentOS4-VM174-bin.002' at position 867, relay log './CentOS4-VM175-relay-bin.001' position: 4
070511 13:49:52 Slave I/O thread: connected to master 'replica@10.210.128.174:3318', asynchronous replication started in log 'CentOS4-VM174-bin.002' at position 867
070511 13:49:52 ReplicationMule: MULE_BEHIND - new(CentOS4-VM174-bin.002, 4), old(CentOS4-VM174-bin.002, 867)
070511 13:49:52 ReplMule::writeEvent =f - new status(1), file(CentOS4-VM174-bin.002) master_log_pos(4), dump_pos(867), file_size(4)
070511 13:49:52 ReplMule::writeEvent =d - new status(2), file(CentOS4-VM174-bin.002) master_log_pos(867), dump_pos(867), file_size(4)
070511 14:09:56 Start mirror_binlog_client, asynchronous binlog_dump to slave_server(128176331, pos(CentOS4-VM174-bin.002, 4)
070511 14:25:02 End binlog_dump successfully: 1281763318
070511 14:25:02 Start mirror_binlog_client, asynchronous binlog_dump to slave_server(128176331, pos(CentOS4-VM174-bin.002, 867)
作者: helbreathszw    時(shí)間: 2007-05-11 15:35
mirrorbinlog可以解決各IDC直接relay-slave數(shù)據(jù)服務(wù)器出現(xiàn)故障之后,能夠保證master的binlog pos不丟失。
最后感謝google的無(wú)私奉獻(xiàn)
作者: zhangweibo    時(shí)間: 2007-05-11 18:32
其他版本可以嗎?特別是4.1.x

[ 本帖最后由 zhangweibo 于 2007-5-11 18:33 編輯 ]
作者: showsa    時(shí)間: 2007-05-11 18:55
4.1 還不支持

http://code.google.com/p/google-mysql-tools/ 自己看就可以了
作者: helbreathszw    時(shí)間: 2007-05-29 22:40
up
作者: Yuri.G.    時(shí)間: 2007-05-30 23:36
怎么個(gè)路子?沒(méi)明白做啥?
是不是我夢(mèng)寐以求的數(shù)據(jù)庫(kù)集群啊?
而且是不均衡集群.就是你是我的主我是你的他的主,然后他又是你的備這樣一個(gè)三角戀關(guān)系啊?
作者: qtfox    時(shí)間: 2007-06-01 15:28
好 ,收藏




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2