Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
oracle_goldengate_apache_cassandra [2020/11/12 16:41] – created andonovj | oracle_goldengate_apache_cassandra [2020/11/12 16:54] (current) – [Start Cassandra] andonovj | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Configuration Destination===== | =====Configuration Destination===== | ||
+ | To configure cassandra configuration we have to follow the steps as the previous topics. | ||
+ | |||
+ | ====Start Cassandra==== | ||
+ | Before starting, we have to install and configure Cassandra: | ||
+ | |||
+ | < | ||
+ | [oracle@hostname ~]$ cd /stage | ||
+ | [oracle@hostname stage]$ mkdir cassandra | ||
+ | [oracle@hostname stage]$ cp cassandra-java-driver-3.1.3.tar.gz cassandra | ||
+ | [oracle@hostname stage]$ cd cassandra | ||
+ | [oracle@hostname cassandra]$ tar xzvf cassandra-java-driver-3.1.3.tar.gz | ||
+ | cassandra-java-driver-3.1.3/ | ||
+ | cassandra-java-driver-3.1.3/ | ||
+ | cassandra-java-driver-3.1.3/ | ||
+ | cassandra-java-driver-3.1.3/ | ||
+ | … Many lines omitted for brevity… | ||
+ | cassandra-java-driver-3.1.3/ | ||
+ | cassandra-java-driver-3.1.3/ | ||
+ | [oracle@hostname cassandra]$ ls -1 cassandra-java-driver-3.1.3apidocs | ||
+ | cassandra-driver-core-3.1.3.jar | ||
+ | cassandra-driver-extras-3.1.3.jar | ||
+ | cassandra-driver-mapping-3.1.3.jar | ||
+ | changelog | ||
+ | lib | ||
+ | src | ||
+ | upgrade_guide | ||
+ | [oracle@ hostname ~]$ cassandra | ||
+ | CompilerOracle: | ||
+ | org/ | ||
+ | … Many lines omitted for brevity… | ||
+ | 1335055093669716, | ||
+ | INFO 08:25:30 Node localhost/ | ||
+ | ------------------------------------------------------------------- | ||
+ | [oracle@ hostname ~]$ cqlsh -u cassandra -p cassandra | ||
+ | Connected to Test Cluster at 127.0.0.1: | ||
+ | [cqlsh 5.0.1 | Cassandra 3.0.10 | CQL spec 3.4.0 | Native protocol v4] | ||
+ | Use HELP for help. | ||
+ | cassandra@cqlsh> | ||
+ | cassandra@cqlsh> | ||
+ | oggsrc system_schema system_auth system system_distributed system_traces | ||
+ | </ | ||
+ | |||
+ | ====Configure Cassandra Properties File==== | ||
+ | |||
+ | < | ||
+ | gg.handlerlist=cassandra | ||
+ | gg.handler.cassandra.type=cassandra | ||
+ | gg.handler.cassandra.mode=op | ||
+ | gg.handler.cassandra.contactPoints=localhost | ||
+ | gg.handler.cassandra.username=cassandra | ||
+ | gg.handler.cassandra.password=cassandra | ||
+ | gg.handler.cassandra.ddlHandling=CREATE, | ||
+ | gg.handler.cassandra.compressedUpdates=true | ||
+ | gg.handler.cassandra.cassandraMode=async | ||
+ | gg.handler.cassandra.consistencyLevel=ONE | ||
+ | |||
+ | goldengate.userexit.timestamp=utc | ||
+ | goldengate.userexit.writers=javawriter | ||
+ | javawriter.stats.display=TRUE | ||
+ | javawriter.stats.full=TRUE | ||
+ | |||
+ | gg.log=log4j | ||
+ | gg.log.level=INFO | ||
+ | gg.report.time=30sec | ||
+ | |||
+ | gg.classpath=/ | ||
+ | 3.1.3/ | ||
+ | jvm.bootoptions=-Xmx512m -Xms32m - | ||
+ | Djava.class.path=.: | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ====Configure Golden Gate==== | ||
+ | Now, we have to configure the Golden Gate (Replicat) | ||
+ | |||
+ | < | ||
+ | [oracle@edvmr1p0 dirprm]$ trg | ||
+ | [oracle@edvmr1p0 oggtrg]$ ggsci | ||
+ | |||
+ | Oracle GoldenGate Command Interpreter | ||
+ | Version 12.2.0.1.160823 OGGCORE_OGGADP.12.2.0.1.0_PLATFORMS_161019.1437 | ||
+ | Linux, x64, 64bit (optimized), | ||
+ | Operating system character set identified as UTF-8. | ||
+ | |||
+ | Copyright (C) 1995, 2016, Oracle and/or its affiliates. All rights reserved. | ||
+ | |||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 1> info all | ||
+ | |||
+ | Program | ||
+ | |||
+ | MANAGER | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 2> edit param rcass | ||
+ | |||
+ | REPLICAT rcass | ||
+ | TARGETDB LIBFILE libggjava.so SET | ||
+ | property=dirprm/ | ||
+ | REPORTCOUNT EVERY 1 MINUTES, RATE | ||
+ | GROUPTRANSOPS 1000 | ||
+ | MAP OGGSRC.*, TARGET OGGSRC.*; | ||
+ | :wq | ||
+ | |||
+ | GGSCI (edvmr1p0) 3> add replicat rcass, exttrail ./dirdat/cs | ||
+ | REPLICAT added. | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 4> start rcass | ||
+ | |||
+ | Sending START request to MANAGER ... | ||
+ | REPLICAT RCASS starting | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 5> info all | ||
+ | |||
+ | Program | ||
+ | |||
+ | MANAGER | ||
+ | REPLICAT | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 6> info all | ||
+ | |||
+ | Program | ||
+ | |||
+ | MANAGER | ||
+ | REPLICAT | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 7> | ||
+ | |||
+ | </ | ||
+ | |||
+ | =====Verify===== | ||
+ | To verify the configuration, | ||
+ | |||
+ | |||
+ | < | ||
+ | [oracle@edvmr1p0 ~]$ sqlplus oggsrc/ | ||
+ | |||
+ | SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 12 16:47:33 2020 | ||
+ | |||
+ | Copyright (c) 1982, 2014, Oracle. | ||
+ | |||
+ | Last Successful login time: Thu Nov 12 2020 16:13:25 +00:00 | ||
+ | |||
+ | Connected to: | ||
+ | Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production | ||
+ | With the Partitioning, | ||
+ | |||
+ | SQL> insert into product_prod select * from product where product_id > 1000 and product_id < 6001; | ||
+ | |||
+ | 5000 rows created. | ||
+ | |||
+ | SQL> commit; | ||
+ | |||
+ | Commit complete. | ||
+ | |||
+ | SQL> | ||
+ | </ | ||
+ | |||
+ | Now, we can check if that database has been send over the Golden Gate | ||
+ | |||
+ | |||
+ | < | ||
+ | --Source | ||
+ | [oracle@edvmr1p0 oggtrg]$ src | ||
+ | [oracle@edvmr1p0 oggsrc]$ ggsci | ||
+ | |||
+ | Oracle GoldenGate Command Interpreter for Oracle | ||
+ | Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO | ||
+ | Linux, x64, 64bit (optimized), | ||
+ | Operating system character set identified as UTF-8. | ||
+ | |||
+ | Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved. | ||
+ | |||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 1> info all | ||
+ | |||
+ | Program | ||
+ | |||
+ | MANAGER | ||
+ | EXTRACT | ||
+ | EXTRACT | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 2> send priex, stats | ||
+ | |||
+ | Sending STATS request to EXTRACT PRIEX ... | ||
+ | |||
+ | Start of Statistics at 2020-11-12 16:48:10. | ||
+ | |||
+ | DDL replication statistics (for all trails): | ||
+ | |||
+ | *** Total statistics since extract started | ||
+ | Operations | ||
+ | |||
+ | Output to ./ | ||
+ | |||
+ | Extracting from OGGSRC.PRODUCT_PROD to OGGSRC.PRODUCT_PROD: | ||
+ | |||
+ | *** Total statistics since 2020-11-12 16:47:45 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | *** Daily statistics since 2020-11-12 16:47:45 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | *** Hourly statistics since 2020-11-12 16:47:45 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | *** Latest statistics since 2020-11-12 16:47:45 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | End of Statistics. | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 3> | ||
+ | |||
+ | --Target | ||
+ | GGSCI (edvmr1p0) 6> info all | ||
+ | |||
+ | Program | ||
+ | |||
+ | MANAGER | ||
+ | REPLICAT | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 7> send rcass, stats | ||
+ | |||
+ | Sending STATS request to REPLICAT RCASS ... | ||
+ | |||
+ | Start of Statistics at 2020-11-12 16:48:17. | ||
+ | |||
+ | Replicating from OGGSRC.PRODUCT_PROD to OGGSRC.PRODUCT_PROD: | ||
+ | |||
+ | *** Total statistics since 2020-11-12 16:47:47 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | *** Daily statistics since 2020-11-12 16:47:47 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | *** Hourly statistics since 2020-11-12 16:47:47 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | *** Latest statistics since 2020-11-12 16:47:47 *** | ||
+ | Total inserts | ||
+ | Total updates | ||
+ | Total deletes | ||
+ | Total discards | ||
+ | Total operations | ||
+ | |||
+ | End of Statistics. | ||
+ | |||
+ | |||
+ | GGSCI (edvmr1p0) 8> | ||
+ | </ | ||
+ | |||
+ | Finally, we can verify the application on Cassandra: | ||
+ | |||
+ | < | ||
+ | [oracle@edvmr1p0 ~]$ cqlsh -u cassandra -p cassandra | ||
+ | Connected to Test Cluster at 127.0.0.1: | ||
+ | [cqlsh 5.0.1 | Cassandra 3.0.10 | CQL spec 3.4.0 | Native protocol v4] | ||
+ | Use HELP for help. | ||
+ | cassandra@cqlsh> | ||
+ | cassandra@cqlsh> | ||
+ | |||
+ | oggsrc | ||
+ | |||
+ | cassandra@cqlsh> | ||
+ | ... ; | ||
+ | cassandra@cqlsh: | ||
+ | |||
+ | product_prod | ||
+ | |||
+ | cassandra@cqlsh: | ||
+ | |||
+ | count | ||
+ | ------- | ||
+ | 5000 | ||
+ | |||
+ | (1 rows) | ||
+ | |||
+ | Warnings : | ||
+ | Aggregation query used without partition key | ||
+ | |||
+ | cassandra@cqlsh: | ||
+ | </ |