<property>
<name>google.bigtable.auth.json.keyfile</name>
<value>JSON_FILE_PATH</value>
<description>
Service account JSON file to connect to Cloud Bigtable
</description>
</property>
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[[["\u003cp\u003eThe Cloud Bigtable HBase replication library allows for asynchronous replication of data from an HBase cluster to a Bigtable instance using the HBase replication service, and is a part of the open-source Cloud Bigtable HBase client for Java.\u003c/p\u003e\n"],["\u003cp\u003eThis replication library supports use cases like online migration to Bigtable with minimal downtime, data recovery, centralizing datasets from multiple HBase clusters, and extending your HBase footprint.\u003c/p\u003e\n"],["\u003cp\u003eReplication from HBase to Bigtable is eventually consistent and can be configured at the cluster, table, or column family level, utilizing the write-ahead log (WAL) of the source HBase cluster to push mutations.\u003c/p\u003e\n"],["\u003cp\u003eTo use the replication library, you need to set up authentication with a service account, configure \u003ccode\u003ehbase-site.xml\u003c/code\u003e properties, create a destination Bigtable instance with matching tables and column families, and install the library on every HBase server.\u003c/p\u003e\n"],["\u003cp\u003eThe process of migrating from HBase to Bigtable using the library involves enabling replication, adding a Bigtable replication endpoint, temporarily disabling the Bigtable peer, conducting an offline migration of existing data, and then re-enabling the peer to drain the buffer of new writes.\u003c/p\u003e\n"]]],[],null,["Replicate from HBase to Bigtable\n\nThe *Cloud Bigtable HBase replication library* is a component of the\nopen-source [Cloud Bigtable HBase client for\nJava](https://github.com/googleapis/java-bigtable-hbase#readme).\nThe replication library lets you asynchronously replicate data from an HBase\ncluster to a Bigtable instance using the HBase replication\nservice, so you can perform an **online migration** from HBase to\nBigtable. To review the README and source code, visit the [GitHub\nrepository](https://github.com/googleapis/java-bigtable-hbase/tree/main/hbase-migration-tools/bigtable-hbase-replication#readme).\n\nFor offline migration from HBase to Bigtable, see [Migrate data\nfrom HBase to Bigtable\noffline](/bigtable/docs/migrate-hbase-data-to-bigtable).\n\nUse cases\n\n- **Online migration to Bigtable** - You can use the Bigtable HBase replication library, in conjunction with an offline migration of your existing HBase data, to [migrate from HBase to\n Bigtable](#migrate) with almost no downtime.\n- **Data recovery** - Prepare for the unexpected by replicating your HBase data to an offsite Bigtable instance.\n- **Centralizing datasets** - Use the library to replicate data from HBase clusters in multiple locations to a single Bigtable instance that automatically handles replication among its clusters.\n- **Extending your HBase footprint** - Replicate to a Bigtable instance that has clusters in locations beyond your current HBase locations.\n\nOverview\n\nThe Bigtable HBase replication library extends the base\n[HBase replication](https://www.google.com/url?q=https://hbase.apache.org/book.html%23_cluster_replication&sa=D&source=docs&ust=1647884036317413&usg=AOvVaw2JmSun0VJ55n0dPqRQgydA)\nservice. Data that is written to an HBase cluster is replicated asynchronously\nto a Bigtable instance in the same way that standard HBase\nreplication copies data to another HBase cluster. The library uses the\nwrite-ahead log (WAL) of the source HBase cluster to push the mutations to the\nBigtable instance.\n\nYou can replicate an entire HBase cluster to Bigtable or\nreplicate only specific tables or column families. In other words, HBase\nreplication is enabled at the cluster, table, or column family level.\n\nReplication from HBase to Bigtable is\n[eventually consistent](https://en.wikipedia.org/wiki/Eventual_consistency).\n\nMigrate to Bigtable\n\nThe Bigtable HBase replication library lets you migrate to\nBigtable without pausing your application.\n\nAt a high level, the steps for online migration from HBase to\nBigtable are as follows. See the\n[README](https://github.com/googleapis/java-bigtable-hbase/tree/main/hbase-migration-tools/bigtable-hbase-replication#readme)\nfor more details.\n\n1. Before you begin, follow the [setup and configuration steps](#set-up).\n2. Enable replication on your HBase cluster.\n3. Add a Bigtable replication endpoint as a [peer](#add-peer).\n4. Disable the Bigtable peer. This causes writes to HBase from that point onward to buffer on the HBase cluster.\n5. Once the buffering has started to capture new writes, follow the [offline migration guide](/architecture/hadoop/hadoop-gcp-migration-data-hbase-to-bigtable) to migrate a snapshot of your existing HBase data.\n6. When the offline migration is complete, re-enable the Bigtable peer to let the buffer drain and replay writes on Bigtable.\n7. After the buffer is drained, restart your application to send requests to Bigtable.\n\nSet up and configure the replication library\n\nBefore you can use the Bigtable HBase replication, you need to\ncomplete the tasks in this section.\n\nConfigure authentication\n\nTo ensure that the replication library has permission to write to\nBigtable, follow the steps at\n[Create a service account](/iam/docs/service-accounts-create).\nAssign the role\n[roles/bigtable.user](/bigtable/docs/access-control#roles)\nto the newly created service account.\n\nNext, add the following to your `hbase-site.xml` file across the entire HBase\ncluster. \n\n \u003cproperty\u003e\n \u003cname\u003egoogle.bigtable.auth.json.keyfile\u003c/name\u003e\n \u003cvalue\u003e\u003cvar translate=\"no\"\u003eJSON_FILE_PATH\u003c/var\u003e\u003c/value\u003e\n \u003cdescription\u003e\n Service account JSON file to connect to Cloud Bigtable\n \u003c/description\u003e\n \u003c/property\u003e\n\nReplace \u003cvar translate=\"no\"\u003eJSON_FILE_PATH\u003c/var\u003e with the path to the JSON file that\nyou downloaded.\n\nFor additional properties that you can set, see\n[HBaseToCloudBigtableReplicationConfiguration](https://github.com/googleapis/java-bigtable-hbase/blob/main/hbase-migration-tools/bigtable-hbase-replication/bigtable-hbase-replication-core/src/main/java/com/google/cloud/bigtable/hbase/replication/configuration/HBaseToCloudBigtableReplicationConfiguration.java).\n\nCreate a destination instance and tables\n\nBefore you can replicate from HBase to Bigtable,\n[create a Bigtable instance](/bigtable/docs/creating-instance).\nA Bigtable instance can have one cluster or multiple clusters\nthat operate in a multi-primary fashion. Requests from the HBase replication\nservice are routed to the closest cluster in the Bigtable\ninstance, then replicated to the other clusters in the instance.\n| **Important:** To maintain the order of writes, connect to your Bigtable instance with an app profile that uses [single-cluster routing](/bigtable/docs/app-profiles#routing). Include the app profile ID as a config key in your [`hbase-site.xml`](#set-config-properties). To learn more about connecting with an app profile, see [Create and configure app profiles](/bigtable/docs/configuring-app-profiles).\n\nYour Bigtable destination table needs to have the same name\nand same column families as your HBase table. For step-by-step instructions on\nusing the Bigtable Schema Translation tool to create a table with\nthe same schema as your HBase table, see\n[Migrate data from HBase to Bigtable offline](/bigtable/docs/migrate-hbase-data-to-bigtable).\nEven though you are replicating, rather than importing your data, the steps are\nthe same.\n\nSet the config properties\n\nAdd the following to your `hbase-site.xml` across the entire HBase cluster. \n\n \u003cproperty\u003e\n \u003cname\u003egoogle.bigtable.project.id\u003c/name\u003e\n \u003cvalue\u003e\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\u003c/value\u003e\n \u003cdescription\u003e\n Bigtable project ID\n \u003c/description\u003e\n \u003c/property\u003e\n \u003cproperty\u003e\n \u003cname\u003egoogle.bigtable.instance.id\u003c/name\u003e\n \u003cvalue\u003e\u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\u003c/value\u003e\n \u003cdescription\u003e\n Bigtable instance ID\n \u003c/description\u003e\n \u003c/property\u003e\n \u003cproperty\u003e\n \u003cname\u003egoogle.bigtable.app_profile.id\u003c/name\u003e\n \u003cvalue\u003e\u003cvar translate=\"no\"\u003eAPP_PROFILE_ID\u003c/var\u003e\u003c/value\u003e\n \u003cdescription\u003e\n Bigtable app profile ID\n \u003c/description\u003e\n \u003c/property\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The Google Cloud project that your Bigtable instance is in.\n- \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e: The ID of the Bigtable instance that you are replicating your data to.\n- \u003cvar translate=\"no\"\u003eAPP_PROFILE_ID\u003c/var\u003e: The ID of the app profile to use to connect to Bigtable.\n\nInstall the replication library\n\nTo use the Bigtable HBase replication library, you need to\ninstall it on *every* server in the HBase cluster. Use the replication library\nversion that corresponds to your HBase version (1.x or 2.x).\n\nDownload the JAR\n\nTo get the replication library, run the following in the HBase shell. \n\n wget \u003cvar translate=\"no\"\u003eBIGTABLE_HBASE_REPLICATION_URL\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eBIGTABLE_HBASE_REPLICATION_URL\u003c/var\u003e with the URL of the\nlatest JAR with dependencies available in the replication library's Maven\nrepository. The filename is similar to\n`https://repo1.maven.org/maven2/com/google/cloud/bigtable/bigtable-hbase-1.x-replication/1.0.0/bigtable-hbase-1.x-replication-1.0.0-jar-with-dependencies.jar`.\n\nTo find the URL or to manually download the JAR, do the following.\n\n1. Go to the replication library repository for the version of HBase that you are using.\n - [HBase 1.x](https://repo1.maven.org/maven2/com/google/cloud/bigtable/bigtable-hbase-1.x-replication/)\n - [HBase 2.x](https://repo1.maven.org/maven2/com/google/cloud/bigtable/bigtable-hbase-2.x-replication/)\n2. Click the most recent version number, such as `1.0.0`.\n3. Identify the **jar-with-dependencies** file (usually at the top).\n4. Either right-click and copy the URL, or click to download the file.\n\nInstall the JAR\n\nOn every HBase server, including the master and region servers, copy the file\nthat you just downloaded to a folder in the HBase classpath. For example,\nyou might copy the file to `/usr/lib/hbase/lib/`.\n\nAdd a Bigtable peer\n\nTo replicate from HBase to Bigtable, you need to add a\nBigtable endpoint as a replication peer.\n\n1. Restart the HBase servers to ensure that the replication library is loaded.\n2. Run the following in the HBase shell.\n\n add_peer \u003cvar translate=\"no\"\u003ePEER_ID_NUMBER\u003c/var\u003e, ENDPOINT_CLASSNAME =\u003e\n 'com.google.cloud.bigtable.hbase\u003cvar translate=\"no\"\u003eHBASE_VERSION_NUMBER\u003c/var\u003e_x.replication.HbaseToCloudBigtableReplicationEndpoint`\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePEER_ID_NUMBER\u003c/var\u003e: An integer ID for the\n Bigtable replication peer. To enable HBase replication of only\n select tables, use an [`add_peer` optional parameter](https://github.com/apache/hbase/blob/master/hbase-shell/src/main/ruby/shell/commands/add_peer.rb).\n\n- \u003cvar translate=\"no\"\u003eHBASE_VERSION_NUMBER\u003c/var\u003e: The number of the HBase version that\n you are using. Use `1` for HBase 1.x and `2` for HBase 2.x. (HBase 3.x is not\n supported.)\n\nWhat's next\n\n- [Review an overview of Bigtable's storage model, architecture, and features.](/bigtable/docs/overview)\n- [Learn some of the differences between HBase and Bigtable](/bigtable/docs/hbase-differences)."]]