Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop...
-
Upload
paula-collins -
Category
Documents
-
view
214 -
download
1
Transcript of Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop...
![Page 1: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/1.jpg)
Heterogeneous Database ReplicationGianni Pucciani
LCG Database Deployment and Persistency WorkshopCERN 17-19 October 2005
A.Domenici [email protected] [email protected] [email protected] [email protected] [email protected]
![Page 2: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/2.jpg)
Introduction
• Oracle Heterogeneous Connectivity.
• Streams based heterogeneous replication.
• The Constanza project.
• RCS architecture.
• RCS for Oracle to MySQL replication.
• Conclusions.
2Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 3: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/3.jpg)
Tests on Oracle Heterogeneous Connectivity and Streams based replication
Laura Iannone's thesis available at: http://etd.adm.unipi.it/theses/available/etd-0621005-153510/
Oracle solutions to the Heterogeneous Connectivity problem:
• Transparent Gateways: only provides gateways for specific non-Oracle platforms like Sybase, MS SQL, Informix etc. MySQL is NOT supported.
• Generic Connectivity: more limited functionality than Transparent Gateways, connection only to local Oracle Database server, no distributed transactions.
Both provide the ability to transparently access data in non-Oracle databases from an Oracle environment.
3Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 4: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/4.jpg)
Oracle Heterogeneous Connectivity
The Heterogeneous Connectivity process:
● Heterogeneous service: integrated in the Oracle server.● Agent: provides connectivity to non-Oracle systems.
Transparent Gateways and Generic Connectivity are two types of agents.
4Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 5: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/5.jpg)
Oracle Generic Connectivity test
Oracle machine located at CNAF (SL, Oracle 10.1.0.2.0)
MySQL machine at INFN Pisa (RH9, MySQL 4.1.9).
- Setting up Oracle Heterogeneous Services.
- Setting up ODBC Driver.
- Setting up Generic Connectivity Agent.
Eventually, we were able to successfully update the remote MySQL database from the Oracle SQL*Plus
console .
5Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 6: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/6.jpg)
Oracle to MySQL data sharing with Streams 1/2
In some Oracle documents we found that Streams can apply changes to a non-Oracle system via Transparent Gateways or
Generic Connectivity.
- We set up an Oracle Streams environment with the apply process linked to the remote MySQL database.
- We created a simple table on both the Oracle and MySQL database.
- With the Streams processes activated we tried to make some DML changes to the Oracle table.
6Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 7: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/7.jpg)
Oracle to MySQL data sharing with Streams 2/2
Results: altough we can access a remote MySQL databasefrom an Oracle server, the Streams tool does not workwith MySQL.
So, we need to look for different solutions to implement Oracle to MySQL synchronisation.
The capture process correctly captured changes but the apply process aborted. Oracle support has been contacted and they told us that Streams needs to have an Oracle Transparent Gateway for the Oracle to non-Oracle data sharing.
7Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 8: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/8.jpg)
The CONStanza project
• Developed at INFN, funded by the Italian FIRB project• Site: http://www.pi.infn.it/~pucciani/constanza• Main goals: developing a Replica Consistency Service (RCS) that maintains consistency of writable replicated datasets (files and databases) in a Grid environment.• Current focus on:
• heterogeneous database replication of VOMS DB from Oracle to MySQL
• simple but reliable protocol for update propagation (single master).
8Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 9: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/9.jpg)
RCS: general features
● Designed as flexible as possible to support multiple update propagation protocols and update mechanisms.
● Prototype implemented in C++ with gSOAP as communication framework.
● Other used/to be used tools are: Autotools, doxygen, CppUnit with mockpp, CGSI.
● Using a configuration file we can set most RCS properties.
9Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 10: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/10.jpg)
RCS: particular features
● Dynamic replica subscription.● Update requests can be both blocking and non-
blocking.● Quorum constraint on update requests.● Fault tolerant communication.● For DB replicas: limited SQL dialect/data types
translation.
10Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 11: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/11.jpg)
RCS Architecture
• GRCS, entry point for user requests (bottleneck and single point of failure issues will be addressed if needed).
• LRCSs, distributed servers “close” to replicas.
11Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 12: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/12.jpg)
RCS: architecture for DBs
Two specialised components have been added to extract/apply updates to databases:
• Log Watcher• DB Updater
12Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 13: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/13.jpg)
RCS: current status
● The current architecture works with homogeneous MySQL databases.
● It monitors the master DB log file, extracts last updates and propagates them to the RCS registered secondary replicas. Updates are then applied to each secondary replica.
● If a replica is temporarily unreachable, a tentative update can be repeated later on.
13Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 14: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/14.jpg)
RCS: current scenario
VOMS1LogWatcher
Extract Log
LogVOMS001
GRCS
LRCSLRCS
Notify GRCS
VOMS2VOMS3
Update Replica Update Replica
LogVOMS000LogVOMS001
DBUpdater
GridFTP
Apply Update
VOMS1
VOMS2VOMS3
RCS
Update Master
14Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 15: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/15.jpg)
RCS: fault tolerant links
● GRCSLRCSs: when an LRCS is not reachable, the update operation involved is stored in a queue to be executed later on, periodically or upon an LRCS request.
● Log Watcher GRCS and DB Updater DB links will use a similar system.
15Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 16: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/16.jpg)
RCS: first results
Preliminary performance tests done using a master DB located in Pisa and secondary DBs at CERN (50ms RTT) and SLAC (165ms RTT).
16Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 17: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/17.jpg)
RCS: Oracle to MySQL replication
● The LogWatcher component can be specialised to work with Oracle as it works with MySQL using the Oracle LogMiner utility and the OCCI interface (work in progress).
● The difficult problem of SQL dialect translation will be addressed for special cases (starting with VOMS use case). A general SQL statement translation module is almost impossible to build. Solutions can be:– Reducing the use of non-standard SQL statetements.– Agreeing on a common application-level interface for log
storage/exctraction/application.
17Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)
![Page 18: Heterogeneous Database Replication Gianni Pucciani LCG Database Deployment and Persistency Workshop CERN 17-19 October 2005 A.Domenici andrea.domenici@iet.unipi.itandrea.domenici@iet.unipi.it.](https://reader035.fdocuments.net/reader035/viewer/2022071808/56649eef5503460f94bff7e2/html5/thumbnails/18.jpg)
Conclusions
● Oracle Streams does not work with MySQL.● Can a Transparent Gateway driver be done for
MySQL as well?● CONStanza RCS. ● Using Log Miner RCS should be able to
synchronise an Oracle DB with MySQL DBs.● The problem of non-standard SQL dialects must
be addressed.
18Heterogeneous Database Replication – CERN LCG 3D Workshop (2005-10-18)