Building simple and complex clusters with tungsten replicator
-
Upload
giuseppe-maxia -
Category
Technology
-
view
1.730 -
download
2
description
Transcript of Building simple and complex clusters with tungsten replicator
![Page 1: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/1.jpg)
©Continuent 2012.
Giuseppe MaxiaQA DirectorContinuent, Inc
@datacharmer
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License.
Building simple and complex
replication clusters with Tungsten
Replicator
1
1Tuesday, February 7, 12
![Page 2: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/2.jpg)
From the user'sstandpoint
2Tuesday, February 7, 12
![Page 3: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/3.jpg)
BINARY LOG
REPLICATION
MySQLDBMS
trans
actio
n
trans
actio
n
trans
actio
n
trans
actio
n
trans
actio
ntra
nsac
tion
trans
actio
ntra
nsac
tion
trans
actio
ntra
nsac
tion
trans
actio
n
MySQLDBMS
transactiontransaction
transactiontransaction
transactiontransaction
transactiontransaction
transactiontransaction
transactiontransaction
MySQL replicationis single threaded
3Tuesday, February 7, 12
![Page 4: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/4.jpg)
MySQLDBMS
MySQLDBMS
MySQLDBMS
MySQLDBMS
master
slave slaveslave
MySQLDBMS
MySQLDBMS
MySQLDBMS
MySQLDBMS
master master master
slave
single source multi source (fan-in)
multiple sources?4Tuesday, February 7, 12
![Page 5: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/5.jpg)
MySQLDBMS
MySQLDBMS
MySQLDBMS
MySQLDBMS
mastermaster
master master
from this to this
multiple masters?
5Tuesday, February 7, 12
![Page 6: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/6.jpg)
MySQLDBMS
MySQLDBMS
MySQLDBMS
MySQLDBMS
mastermaster
master master
Avoiding conflicts?
INSERT RECORD
A
INSERT RECORD
A
MODIFY RECORD
B
MODIFY RECORD
B
6Tuesday, February 7, 12
![Page 7: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/7.jpg)
MySQLDBMS
MySQLDBMS
MySQLDBMS
master
slaveslave
MySQLDBMS
MySQLDBMS
MySQLDBMS
master
slaveslave
MySQLDBMS
MySQLDBMS
MySQLDBMS
master
slaveslave
Seamless failover?
7Tuesday, February 7, 12
![Page 8: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/8.jpg)
MySQLDBMS
MySQLDBMS
mysql master
postgresqlmysql
Replicating to something else?
oracle mongodb
8Tuesday, February 7, 12
![Page 9: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/9.jpg)
All these examples tell us:
Nice dream, but MySQL can’t do it
9Tuesday, February 7, 12
![Page 10: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/10.jpg)
Enter Tungsten Replicator
10Tuesday, February 7, 12
![Page 11: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/11.jpg)
http://code.google.com/p/tungsten-replicator
100% GPL v2Open Source
11Tuesday, February 7, 12
![Page 12: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/12.jpg)
What can it do?
• Easy failover
• Multiple masters
• Multiple sources to a single slave
• Conflict prevention
• Parallel replication
• Replicate to Oracle and PostgreSQL database
12Tuesday, February 7, 12
![Page 13: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/13.jpg)
©Continuent 2012.
star-schema
master-slave Heterogeneous Direct slave
fan-in slave all-masters
MySQL
Oracle
Oracle
MySQL
RegularMySQL Master
13Tuesday, February 7, 12
![Page 14: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/14.jpg)
Main components
• Transaction History Logs (THL)
• roughly corresponding to MySQL relay logs
• have a lot of metadata
• Service database
• contains metadata for latest transactions
• Metadata is committed together with data
• Makes slaves crash proof
14Tuesday, February 7, 12
![Page 15: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/15.jpg)
Parallel replication
15Tuesday, February 7, 12
![Page 16: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/16.jpg)
Parallel replication facts
✓Sharded by database
✓Good choice for slave lag problems
❖Bad choice for single database projects
16Tuesday, February 7, 12
![Page 17: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/17.jpg)
Parallel Replication test
binary logs
MySQL slave
Tungsten slave
OFFLINE
STOPPED
replicator alpha
direct: alpha(slave)
Concurrent sysbenchon 30 databasesrunning for 1 hour
TOTAL DATA: 130 GBRAM per server: 20GB
Slaves will have 1 hour lag17Tuesday, February 7, 12
![Page 18: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/18.jpg)
measuring results
binary logs
MySQL slave
Tungsten slave
ONLINE
START
replicator alpha
direct: alpha(slave)
Recording catch-up time
18Tuesday, February 7, 12
![Page 19: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/19.jpg)
MySQL native replication
slave catch up in 04:29:30
19Tuesday, February 7, 12
![Page 20: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/20.jpg)
Tungsten parallel replication
slave catch up in 00:55:40
20Tuesday, February 7, 12
![Page 21: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/21.jpg)
Parallel replication made simpler
FROM HERE ....21Tuesday, February 7, 12
![Page 22: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/22.jpg)
Parallel replication made simpler
TO HERE22Tuesday, February 7, 12
![Page 23: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/23.jpg)
Parallel replication made simpler
23Tuesday, February 7, 12
![Page 24: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/24.jpg)
parallel replicationdirect slave facts
24Tuesday, February 7, 12
![Page 25: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/25.jpg)
parallel replicationdirect slave facts
✓No need to install Tungsten on the master
24Tuesday, February 7, 12
![Page 26: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/26.jpg)
parallel replicationdirect slave facts
✓No need to install Tungsten on the master
✓Tungsten runs only on the slave
24Tuesday, February 7, 12
![Page 27: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/27.jpg)
parallel replicationdirect slave facts
✓No need to install Tungsten on the master
✓Tungsten runs only on the slave
✓Replication can revert to native slave with two commands (trepctl offline; start slave)
24Tuesday, February 7, 12
![Page 28: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/28.jpg)
parallel replicationdirect slave facts
✓No need to install Tungsten on the master
✓Tungsten runs only on the slave
✓Replication can revert to native slave with two commands (trepctl offline; start slave)
✓Native replication can continue on other slaves
24Tuesday, February 7, 12
![Page 29: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/29.jpg)
parallel replicationdirect slave facts
✓No need to install Tungsten on the master
✓Tungsten runs only on the slave
✓Replication can revert to native slave with two commands (trepctl offline; start slave)
✓Native replication can continue on other slaves
❖Failover (either native or Tungsten) becomes a manual task
24Tuesday, February 7, 12
![Page 30: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/30.jpg)
Multiple masters
25Tuesday, February 7, 12
![Page 31: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/31.jpg)
multiple masters
• Tungsten Replicator recipe: use more services
26Tuesday, February 7, 12
![Page 32: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/32.jpg)
Bi-directional replication
27Tuesday, February 7, 12
![Page 33: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/33.jpg)
Bi-directional replication with slaves
28Tuesday, February 7, 12
![Page 34: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/34.jpg)
Multiple sources
29Tuesday, February 7, 12
![Page 35: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/35.jpg)
multiple sources
• Tungsten Replicator recipe is still valid: use more services
30Tuesday, February 7, 12
![Page 36: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/36.jpg)
Multiple source replication
31Tuesday, February 7, 12
![Page 37: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/37.jpg)
Multiple masters replication: 3 nodes
32Tuesday, February 7, 12
![Page 38: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/38.jpg)
Multiple masters replication: 4 nodes
33Tuesday, February 7, 12
![Page 39: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/39.jpg)
star topologies
34Tuesday, February 7, 12
![Page 40: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/40.jpg)
Conflict prevention
35Tuesday, February 7, 12
![Page 41: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/41.jpg)
Conflict prevention facts
36Tuesday, February 7, 12
![Page 42: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/42.jpg)
Conflict prevention facts
• Sharded by database
36Tuesday, February 7, 12
![Page 43: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/43.jpg)
Conflict prevention facts
• Sharded by database
• Defined dynamically
36Tuesday, February 7, 12
![Page 44: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/44.jpg)
Conflict prevention facts
• Sharded by database
• Defined dynamically
• Applied either at the master or at the slave
36Tuesday, February 7, 12
![Page 45: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/45.jpg)
Conflict prevention facts
• Sharded by database
• Defined dynamically
• Applied either at the master or at the slave
• methods:
36Tuesday, February 7, 12
![Page 46: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/46.jpg)
Conflict prevention facts
• Sharded by database
• Defined dynamically
• Applied either at the master or at the slave
• methods:
• make replication fail
36Tuesday, February 7, 12
![Page 47: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/47.jpg)
Conflict prevention facts
• Sharded by database
• Defined dynamically
• Applied either at the master or at the slave
• methods:
• make replication fail
• drop silently
36Tuesday, February 7, 12
![Page 48: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/48.jpg)
Conflict prevention facts
• Sharded by database
• Defined dynamically
• Applied either at the master or at the slave
• methods:
• make replication fail
• drop silently
• drop with warning36Tuesday, February 7, 12
![Page 49: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/49.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Tungsten Conflict prevention points
37Tuesday, February 7, 12
![Page 50: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/50.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Tungsten Conflict prevention points
37Tuesday, February 7, 12
![Page 51: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/51.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Tungsten Conflict prevention points
37Tuesday, February 7, 12
![Page 52: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/52.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: Fail on master
38Tuesday, February 7, 12
![Page 53: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/53.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: Fail on masterINSERT A x,y
INSERT Ax,z
38Tuesday, February 7, 12
![Page 54: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/54.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: Fail on masterINSERT A x,y
INSERT Ax,z
38Tuesday, February 7, 12
![Page 55: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/55.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: Fail on slave
39Tuesday, February 7, 12
![Page 56: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/56.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: Fail on slaveINSERT A x,y
INSERT Ax,z
39Tuesday, February 7, 12
![Page 57: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/57.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: Fail on slaveINSERT A x,y
INSERT Ax,z
39Tuesday, February 7, 12
![Page 58: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/58.jpg)
host1
master
host2
M
M
host3
S
Prevention methods: Fail on slave(Multiple sources)
40Tuesday, February 7, 12
![Page 59: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/59.jpg)
host1
master
host2
M
M
host3
S
Prevention methods: Fail on slaveINSERT A x,y
INSERT Ax,z
(Multiple sources)
40Tuesday, February 7, 12
![Page 60: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/60.jpg)
host1
master
host2
M
M
host3
S
Prevention methods: Fail on slaveINSERT A x,y
INSERT Ax,z
(Multiple sources)
40Tuesday, February 7, 12
![Page 61: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/61.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: DROP on master
41Tuesday, February 7, 12
![Page 62: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/62.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: DROP on masterINSERT B x,y
41Tuesday, February 7, 12
![Page 63: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/63.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: DROP on masterINSERT B x,y
INSERT Bx,z
41Tuesday, February 7, 12
![Page 64: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/64.jpg)
host1host3
master
host2
M
MS
SS
host4
S
Prevention methods: DROP on master
INSERT Bx,z
41Tuesday, February 7, 12
![Page 65: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/65.jpg)
host1
master
host2
M
M
host3
S
Prevention methods: DROP on slave(Multiple sources)
42Tuesday, February 7, 12
![Page 66: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/66.jpg)
host1
master
host2
M
M
host3
S
Prevention methods: DROP on slaveINSERT A x,y
INSERT Ax,z
(Multiple sources)
42Tuesday, February 7, 12
![Page 67: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/67.jpg)
host1
master
host2
M
M
host3
S
Prevention methods: DROP on slave
INSERT Bx,z
(Multiple sources)
INSERT B x,y
43Tuesday, February 7, 12
![Page 68: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/68.jpg)
host1
master
host2
M
M
host3
S
Prevention methods: DROP on slave
INSERT Bx,z
(Multiple sources)
43Tuesday, February 7, 12
![Page 69: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/69.jpg)
Tungsten in practiceInstallation
44Tuesday, February 7, 12
![Page 70: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/70.jpg)
Installation
• Check the requirements
• Get the binaries
• Expand the tarball
• Run ./tools/tungsten-installer
45Tuesday, February 7, 12
![Page 71: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/71.jpg)
REQUIREMENTS
• Java JRE or JDK (Sun/Oracle or Open-jdk)
• Ruby 1.8 (only during installation)
• ssh access to the same user in all nodes
• MySQL user with all privileges
46Tuesday, February 7, 12
![Page 72: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/72.jpg)
Installation types
• master / slave
• slave - direct
47Tuesday, February 7, 12
![Page 73: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/73.jpg)
master/slave
binlog
THL
THL
slave
slave
master
host1host2
host3
THL
48Tuesday, February 7, 12
![Page 74: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/74.jpg)
slave direct
binlogTHL
slavemaster
relay log
host1host2
host3
THL
slave
relay log
49Tuesday, February 7, 12
![Page 75: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/75.jpg)
sample installation
• 4 servers
• qa.r1.continuent.com r1
• qa.r2.continuent.com r2
• qa.r3.continuent.com r3
• qa.r4.continuent.com r4
• MySQL 5.1
• tungsten-replicator-2.0.4
50Tuesday, February 7, 12
![Page 76: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/76.jpg)
Installation (1)# starting at node 4, but any would do
for N in 1 2 3 4do ssh r$N mkdir tinstalldone
cd tinstalltar -xzf /path/to/tungsten-replicator-2.0.4.tar.gzcd tungsten-replicator-2.0.4
51Tuesday, February 7, 12
![Page 77: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/77.jpg)
Installation (2)export TUNGSTEN_BASE=$HOME/tinstall
./tools/tungsten-installer \ --master-slave \ --master-host=r1 \ --datasource-user=tungsten \ --datasource-password=secret \ --service-name=dragon \ --home-directory=$TUNGSTEN_BASE \ --cluster-hosts=r1,r2,r3,r4 \ --start
1 2 3 4 5 6 7 8 9
52Tuesday, February 7, 12
![Page 78: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/78.jpg)
Installation (2)export TUNGSTEN_BASE=$HOME/tinstall
./tools/tungsten-installer \ --master-slave \ # installation mode --master-host=r1 \ # who’s the master --datasource-user=tungsten \ # mysql username --datasource-password=secret \ # mysql password --service-name=dragon \ # name of the service --home-directory=$TUNGSTEN_BASE \ # where we install --cluster-hosts=r1,r2,r3,r4 \ # hosts in cluster --start # start replicator after installing
53Tuesday, February 7, 12
![Page 79: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/79.jpg)
What does the installation do
host4
1: Validate all servers
✔✗✔
✔
host1
✔✗✔
✔
host2
✔✗✔
✔
host3
✔✗✔
✔
Report all errors54Tuesday, February 7, 12
![Page 80: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/80.jpg)
What does the installation do
host4
1 (again): Validate all servers
✔
✔
✔
host1
✔
✔
✔
host2
✔
✔
✔
host3
✔
✔
✔
✔✔ ✔ ✔
55Tuesday, February 7, 12
![Page 81: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/81.jpg)
What does the installation do
2: install Tungsten in all servers
host3
$HOME/ tinstall/ config/ releases/ relay/ logs/ tungsten/
host4host1
host2
56Tuesday, February 7, 12
![Page 82: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/82.jpg)
examplessh r2 chmod 444 $HOME/tinstall./tools/tungsten-installer \ --master-slave --master-host=r1 \ --datasource-user=tungsten \ --datasource-password=secret \ --service-name=dragon \ --home-directory=$HOME/tinstall \ --thl-directory=$HOME/tinstall/logs \ --relay-directory=$HOME/tinstall/relay \ --cluster-hosts=r1,r2,r3,r4 --start
ERROR >> qa.r2.continuent.com >> /home/tungsten/tinstall is not writeable
57Tuesday, February 7, 12
![Page 83: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/83.jpg)
examplessh r2 chmod 755 $HOME/tinstall./tools/tungsten-installer \ --master-slave --master-host=r1 \ --datasource-user=tungsten \ --datasource-password=secret \ --service-name=dragon \ --home-directory=$HOME/tinstall \ --thl-directory=$HOME/tinstall/logs \ --relay-directory=$HOME/tinstall/relay \ --cluster-hosts=r1,r2,r3,r4 --start
# no errors
58Tuesday, February 7, 12
![Page 84: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/84.jpg)
Installation - direct./tools/tungsten-installer \ --direct \ --master-host=r1 \ --slave-host=r4 \ --master-user=tungsten \ --slave-user=tungsten \ --master-password=secret \ --slave-password=secret \ --service-name=Castor \ --channels=1 \ --home-directory=$TUNGSTEN_BASE \ --start-and-report
59Tuesday, February 7, 12
![Page 85: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/85.jpg)
http://bit.ly/tr20_cookbook
60Tuesday, February 7, 12
![Page 86: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/86.jpg)
© Continuent 2011© Continuent 2011
Tungsten Replicator vs. Enterprise
Feature Replicator EnterpriseSimple admin with trepctl X XMySQL Row/Statement 5.0/5.1/5.5 X XMulti-master replication X XParallel apply (2.0) X XDistributed management with cctrl XAutomated failover and recovery XZero-downtime upgrade XSQL routing and load-balancing XFloating IP support X
61Tuesday, February 7, 12
![Page 87: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/87.jpg)
Conclusion and Q&A
62Tuesday, February 7, 12
![Page 88: Building simple and complex clusters with tungsten replicator](https://reader033.fdocuments.in/reader033/viewer/2022052900/5556d9fdd8b42ac60c8b45d4/html5/thumbnails/88.jpg)
©Continuent 2012. 63
Continuent Web Site:http://www.continuent.com
Tungsten Replicator 2.0:http://code.google.com/p/tungsten-replicator
Check out our blogs!http://scale-out-blog.blogspot.comhttp://datacharmer.blogspot.comhttp://flyingclusters.blogspot.com
560 S. Winchester Blvd., Suite 500 San Jose, CA 95128 Tel (866) 998-3642 Fax (408) 668-1009e-mail: [email protected]
63Tuesday, February 7, 12