{"id":15056858,"url":"https://github.com/instaclustr/cassandra-everywhere-strategy","last_synced_at":"2025-04-10T04:34:48.438Z","repository":{"id":40500124,"uuid":"264265732","full_name":"instaclustr/cassandra-everywhere-strategy","owner":"instaclustr","description":"An EverywhereStrategy implementation for Apache Cassandra. Useful for performing DSE Cassandra to Apache Cassandra migrations.","archived":false,"fork":false,"pushed_at":"2025-02-04T18:32:40.000Z","size":89,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T05:51:43.655Z","etag":null,"topics":["apache-cassandra","bootstrap","cassandra","cluster","datastax","dse","dse-cassandra","everywhere","migration","netapp-public","replication","strategy","topology"],"latest_commit_sha":null,"homepage":"https://instaclustr.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instaclustr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-15T18:11:01.000Z","updated_at":"2025-03-13T23:22:47.000Z","dependencies_parsed_at":"2025-02-16T14:38:04.415Z","dependency_job_id":"b8cddd1c-9082-4588-b26a-6b09aa3cd26c","html_url":"https://github.com/instaclustr/cassandra-everywhere-strategy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instaclustr%2Fcassandra-everywhere-strategy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instaclustr%2Fcassandra-everywhere-strategy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instaclustr%2Fcassandra-everywhere-strategy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instaclustr%2Fcassandra-everywhere-strategy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instaclustr","download_url":"https://codeload.github.com/instaclustr/cassandra-everywhere-strategy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248158138,"owners_count":21057117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-cassandra","bootstrap","cassandra","cluster","datastax","dse","dse-cassandra","everywhere","migration","netapp-public","replication","strategy","topology"],"created_at":"2024-09-24T21:57:12.768Z","updated_at":"2025-04-10T04:34:48.401Z","avatar_url":"https://github.com/instaclustr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instaclustr Everywhere Strategy - Migrate from DSE to Apache Cassandra\n\nWebsite: https://www.instaclustr.com/\n\nDocumentation: https://www.instaclustr.com/support/documentation/\n\n[![Bintray Badge](https://img.shields.io/bintray/v/instaclustr/debian/instaclustr-everywhere-strategy.svg)](https://bintray.com/instaclustr/debian/instaclustr-everywhere-strategy)\n\nAn `EverywhereStrategy` implementation for Apache Cassandra.\n\nThis is useful for performing DSE Cassandra → Apache Cassandra migrations.\n\nThe remainder of this README refers to _DSE Cassandra_ as simply _DSE_, and _Apache Cassandra_ as _Cassandra_.\n\nSimply install the JAR into the classpath on all Cassandra nodes. The JAR contains an implementation of `EverywhereStrategy` that\nis compatible with Cassandra.\n\n## Installation\n\n### Cassandra Package Installs\n\nWe offer a packaged version of `instaclustr-everywhere-strategy` for systems where Cassandra has been installed via the official Apache.org Debian or RPM package.\n\nThis package will automatically install `instaclustr-everywhere-strategy` into an appropriate location for the Cassandra package install\n(i.e. `$CASSANDRA_HOME/lib`, which at present is `/usr/share/cassandra/lib`).\n\n_Note_: These packages have a hard dependency for a `cassandra` package.\nIf Cassandra hasn't been installed via your distributions package manager, installing `instaclustr-everywhere-strategy`\nmay force the Cassandra package to be installed. This may conflict with a tarball install.\nSee [Cassandra Tarball Installs](#cassandra-tarball-installs) below on how to install `instaclustr-everywhere-strategy`\nfor tarball installs of Cassandra.\n\n#### Debian-Based Distributions\n\n(Debian, Ubuntu, et al.)\n\n1. Add the `instaclustr/debian` repository.\n\n       echo \"deb https://dl.bintray.com/instaclustr/debian stable main\" \u003e \\\n           /etc/apt/sources.list.d/instaclustr.sources.list\n    \n2. Run `apt-get update` to fetch the contents of the new package repository.\n\n3. Run `apt-get install instaclustr-everywhere-stratgey` to install the package.\n\n#### RPM-Based Distributions\n\n(RHEL, Fedora, CentOS, et al.)\n\n1. Add the `instaclustr/rpm` repository.\n\n       wget -O - https://bintray.com/instaclustr/rpm/rpm | \\\n           sudo tee /etc/yum.repos.d/instaclustr.repo\n\n2. Run `dnf install instaclustr-everywhere-strategy` to install the package.\n\n    Hint: For YUM-based distributions the command is `yum install instaclustr-everywhere-strategy`.\n\n### Cassandra Tarball Installs\n\n1. Download the latest `instaclustr-everywhere-strategy` JAR from the [releases](https://github.com/instaclustr/everywhere-strategy/releases) page.\n\n2. Install the `instaclustr-everywhere-strategy` JAR into the Cassandra classpath.\n\n    Typically the best location is `$CASSANDRA_HOME/lib`.\n\n3. Restart Cassandra.\n\n## Testing\n\nSome automated tests leveraging [Cassandra Cluster Manager](https://github.com/riptano/ccm) (CCM) exist in the\n[`test/`](test/) directory.\n\nThe basic gist of testing is as follows:\n\n1. Create a new keyspace using `EverywhereStrategy`:\n\n       CREATE KEYSPACE example USING replication = {'class': 'EverywhereStrategy'};\n\n    The strategy is installed correctly if the keyspace is created successfully.\n\n1. Create a table under the new keyspace, and insert some data:\n\n       CREATE TABLE example.demo (a text PRIMARY KEY);\n       INSERT INTO example.demo (a) VALUES ('a');\n       INSERT INTO example.demo (a) VALUES ('b');\n       INSERT INTO example.demo (a) VALUES ('c');\n       INSERT INTO example.demo (a) VALUES ('d');\n\n    The strategy is functioning correctly if the data is replicated to all nodes.\n    \n1. Run `nodetool flush` on every node.\n\n1. Run `nodetool compact` on every node.\n\n1. Run `sstabledump` on the table SSTables from each node.\n\n1. Compare the JSON output from each node and confirm that the data in each dump is identical.\n\nSee [DSE → Cassandra Migration Test Results](test/dse-migrate-test-results.md) for the results of running the\nDSE → Cassandra end-to-end tests.\n\n\n## Motivation\n\nDSE uses an internal `EverywhereStrategy` implementation for various `dse_*` keyspaces.\nWhen joining a Cassandra node to a DSE cluster these keyspaces will cause `ClassNotFound` exceptions to be thrown on the Cassandra node.\nThese exceptions result in a schema disagreement. \u003c!-- and what else? --\u003e\n\nIn the `system.log` for a Cassandra node:\n\n    ERROR [InternalResponseStage:1] MigrationTask.java:95 - Configuration exception merging remote schema\n    org.apache.cassandra.exceptions.ConfigurationException: Unable to find replication strategy class 'org.apache.cassandra.locator.EverywhereStrategy'\n        \u003cstacktrace snipped\u003e\n\nand `nodetool describecluster`:\n\n    Cluster Information:\n    \tName: test-cluster\n    \tSnitch: org.apache.cassandra.locator.GossipingPropertyFileSnitch\n    \tDynamicEndPointSnitch: enabled\n    \tPartitioner: org.apache.cassandra.dht.Murmur3Partitioner\n    \tSchema versions:\n    \t\t850859e7-fcca-3516-9d8c-e9a9a205c974: [127.0.0.1, 127.0.0.2, 127.0.0.3]\n    \n    \t\te84b6a60-24cf-30ca-9b58-452d92911703: [127.0.1.1, 127.0.1.2, 127.0.1.3]\n    \t\t\nIn the output above, IPs `127.0.0.*` are DSE nodes, `127.0.1.*` are Cassandra nodes.\n\nOne common solution is to `ALTER` the `dse_*` keyspaces to use `NetworkTopologyStrategy` before joining Cassandra nodes to the cluster.\nWhile this works, it's also dangerous.\nDSE nodes reset the replication strategy back to `EverywhereStrategy` on startup.\nAs a result, if any DSE nodes restart while Cassandra nodes are present in the cluster then schema disagreement will again occur. \n\n\n## Implementation\n\nOur `EverywhereStrategy` implementation extends `NetworkTopologyStrategy`.\nThis is required because various core components inside Cassandra\n(e.g. [`ConsistencyLevel`](https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/ConsistencyLevel.java))\nperform `instanceof NetworkTopologyStrategy` checks when they need to be data center aware.\n\nYet, `NetworkTopologyStrategy` hasn't been designed to be extendable.\nA number of its fields are private final immutable, including `datacenters`, which is the DC→RF mapping.\nSo we resort to reflection to fix this. Yuck! But, it works…\n\n\n## Version Compatibility\n\n| Cassandra Version | Status |\n| --- | --- |\n| 4.x | Supported |\n| 3.11.x | Supported |\n| 3.0.x | Supported |\n| 2.2.x | Supported |\n| 2.1.x | Supported |\n| 2.0.x | Supported |\n\nFor 2.1.x and 2.0.x versions, you can use version 2.2.x, it is compatible.\n\n## License\n\nThis project is licensed under the Apache License, version 2.0. See [LICENSE](LICENSE) for details.\n\n## Instaclustr Support\n\nPlease see our [Open Source Project Status](https://www.instaclustr.com/support/documentation/announcements/instaclustr-open-source-project-status/) page for details on Instaclustr's support status of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstaclustr%2Fcassandra-everywhere-strategy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstaclustr%2Fcassandra-everywhere-strategy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstaclustr%2Fcassandra-everywhere-strategy/lists"}