Create an active-active instance
The primary and secondary nodes of ApsaraDB for HBase are deployed in two different zones within the same region. If a zone becomes unavailable due to events such as power outages or network failures, the high availability (HA) system performs a failover. This ensures the availability of the entire deployment. You can use Lindorm Tunnel Service (LTS) to perform real-time, two-way synchronization of incremental data between the primary and secondary nodes. This topic describes how to create an active-active instance, which is also known as a high availability instance.
Prerequisites
You have created primary and secondary instances for ApsaraDB for HBase or a self-managed HBase. For more information, see Purchase an HBase instance.
You have created an LTS instance. For more information, see Purchase LTS.
You have added the client IP address to the whitelists of the primary and secondary ApsaraDB for HBase instances and the LTS instance. For more information, see Set a whitelist. If the primary or secondary instance is a self-managed HBase instance, such as an EMR HBase instance, add the security group rules for the LTS instance to the security group of the ECS client. This allows the LTS instance to access the self-managed HBase instance. For more information, see Preparations.
Background information
For more information about the primary-secondary disaster recovery solution, see Primary-secondary disaster recovery.
Features
Supports various types of primary and secondary instances. This includes mixed scenarios with ApsaraDB for HBase, EMR HBase, and self-managed HBase.
Supports multiple HBase versions, such as 1.x and 2.x.
Automatically manages data synchronization with latency in the hundreds of milliseconds.
Provides automatic fault tolerance.
Provides a visual interface for operations and maintenance (O&M). The LTS page displays details such as synchronization latency, the number of client connections, and the status of the primary and secondary instances.
Limits
Only cross-zone deployment within the same VPC is supported.
NoteThe LTS instance and the primary and secondary HBase instances must be in the same VPC. The LTS instance and the HBase instances must be in different zones. If no other zone is available, you can create the LTS instance in the same zone as the secondary HBase instance.
LTS instances created after September 18, 2019 support the active-active feature.
Data synchronization between primary and secondary instances supports the eventual consistency model. The strong consistency model is not supported.
Only failover for the HBase service is supported. Failover for Phoenix and Solr is not supported.
Preparations
If you use a self-managed HBase instance, such as an EMR HBase instance, you must add the security group rules for the LTS instance to the security group of the ECS client. This allows the LTS instance to access the EMR HBase instance. The steps are as follows:
Log on to the LTS action page. For more information, see Log on to LTS.
In the upper-right corner of the page, click Configuration Management to open the Modify Configuration Information page.
Click Generate Security Group Rule to download the security group rules for the LTS instance to your computer. For example, the downloaded file is named 1641978974138_securityrule.
Import the security group rules for the LTS instance into the security group of the EMR HBase instance.
Log on to the Alibaba Cloud E-MapReduce console.
Click the ID of the target cluster to open its basic information page.
In the Security section, click the security group ID to open the Security Group Rules page on the ECS console.
In the Access Rule section, click Import Security Group Rule.
In the Import Security Group Rule dialog box, click Select File.
Select the security group rules file for the LTS instance and click Start Import. After the rules are imported, the LTS instance can access the EMR HBase instance.
Add the IP address of the EMR HBase instance to the configuration of the LTS instance.
Log on to the ECS client that is connected to the EMR HBase instance.
Run the following command to view the IP address and domain name of the EMR HBase instance.
/etc/hostsOn the Modify Configuration Information page from Step 2, append the IP address and domain name of the EMR HBase instance to the value of the bds.conf.hosts configuration item.
Click Modify.
Procedure
- Log on to the ApsaraDB for HBase console.
- In the top navigation bar, select the region where the cluster that you want to manage is deployed.
On the Clusters page, click the ID of the LTS instance.
In the navigation pane on the left, choose Active-Active Management.
Click Add Active-Active Instance. In the Add Active-Active Instance dialog box, configure the following parameters.
Parameter
Description
Primary instance
The primary instance can be an ApsaraDB for HBase instance or a self-managed HBase instance. Configure the parameter as follows:
If the primary instance is an ApsaraDB for HBase instance, simply select the primary instance ID.
If the primary instance is a self-managed HBase instance, enter the ZooKeeper connection URL of the instance. The format is
zk1,zk2:port:/hbase.
Primary instance username
If the primary instance is an ApsaraDB for HBase Performance-enhanced Edition instance, enter the username for the instance. The default value is root.
Primary instance password
If the primary instance is an ApsaraDB for HBase Performance-enhanced Edition instance, enter the password that corresponds to the username. The default value is root.
Primary instance name
If the primary instance is a self-managed HBase instance, enter a custom name for the instance.
Primary HDFS connection URL
If the primary instance is a self-managed HBase instance, enter the HDFS connection URL. The format is
hdfs://namenode1:port,namenode2:port.Primary HBase version
If the primary instance is a self-managed HBase instance, select the version of the self-managed HBase.
Primary HBase root directory
If the primary instance is a self-managed HBase instance, enter the root directory of the self-managed HBase, such as
hdfs://hbase-cluster/hbase.Secondary instance
The secondary instance can be an ApsaraDB for HBase instance or a self-managed HBase instance. Configure the parameter as follows:
If the secondary instance is an ApsaraDB for HBase instance, select the instance ID.
If the secondary instance is a self-managed HBase instance, enter the ZooKeeper connection URL of the instance. The format is
zk1,zk2:port:/hbase.
Secondary instance username
If the secondary instance is an ApsaraDB for HBase Performance-enhanced Edition instance, enter the username for the instance. The default value is root.
Secondary instance password
If the secondary instance is an ApsaraDB for HBase Performance-enhanced Edition instance, enter the password that corresponds to the username. The default value is root.
Secondary instance name
If the secondary instance is a self-managed HBase instance, enter a custom name for the instance.
Secondary HDFS connection URL
If the secondary instance is a self-managed HBase instance, enter the HDFS connection URL. The format is
hdfs://namenode1:port,namenode2:port.Secondary HBase version
If the secondary instance is a self-managed HBase instance, select the version of the self-managed HBase.
Backing up the HBase root directory
If the secondary instance is a self-managed HBase instance, enter the root directory of the self-managed HBase, such as
hdfs://hbase-cluster/hbase.Synchronization type
If the secondary instance is a new instance, the active-active feature supports one-click synchronization. Select a synchronization type.
Instance level: Synchronizes all tables in the primary instance.
Table level: Synchronizes specified tables in the primary instance.
No synchronization required: Select this option if the secondary instance is an existing instance and real-time synchronization is already enabled.
Synchronized tables
If you set Synchronization type to Table level, enter the names of the tables to synchronize. Separate multiple table names with commas (,).
Click OK. You can then view the high availability instance ID and the high availability instance endpoint.