How-to: Deploying a GBase 8a MPP Cluster on Alibaba Cloud ECS (Step-by-Step Guide)
Note
GBase 8a MPP Cluster is a massively distributed analytical database independently developed by General Data Technology Co., Ltd. It can be deployed on physical servers, virtual machines, or cloud servers. This article details the entire process of deploying a GBase 8a MPP Cluster environment on three Alibaba Cloud ECS instances (CentOS 7.3). During the process, issues related to cloud networking, ports, and memory were encountered and resolved, making this a guide for avoiding pitfalls when installing GBase in an Alibaba Cloud environment.
Thanks to fellow learner Liu Dada (alias) for compiling and sharing this content. The article is quite long; please read it patiently. The original post is available on CSDN Blog: https://blog.csdn.net/qq_36588424/article/details/109746295
The article is divided into five parts:
1. Configuring a Cloud Enterprise Network Instance and Opening Ports
2. Configuring Passwordless SSH Login
3. Uploading the GBase Installation Package to ECS Instances
4. Installing the GBase 8a Cluster
5. Summary
1. Configuring a Cloud Enterprise Network Instance and Opening Ports
Because I purchased ECS instances under three different Alibaba Cloud accounts, the first challenge was resolving network connectivity. Here is an official Alibaba Cloud document that can be completed in three steps. Official resource: https://www.alibabacloud.com/help/zh/doc-detail/65901.htm
Steps:
1. Activate the Cloud Enterprise Network under Account A
Navigate to the [Cloud Enterprise Network] console. Within the same region, Cloud Enterprise Network is free of charge; cross-region connections incur fees. Link below:
https://cen.console.aliyun.com/
On the Cloud Enterprise Network Instances page, click Create Cloud Enterprise Network Instance.
2. Configure the Cloud Enterprise Network Instance
Name: The name of the Cloud Enterprise Network instance.
Instance Type: Select the instance types to interconnect. For this operation, select Virtual Private Cloud (VPC).
Region: Select the region of the chosen instance. For this operation, select China East 1 (Hangzhou).
Network Instance: Select the instance to attach. For this operation, select VPC Instance.
3. Obtain the ID of the Created Cloud Enterprise Network Instance
The Cloud Enterprise Network instance ID for this operation is cen-xxxxxxxxxxxxx.
4. Account B Authorizes Account A to Attach Its Network Instance
① Log on to the VPC console using Account B. For example, my region is Hangzhou.
Then click the VPC instance ID. In the Cross-Account Authorization for Cloud Enterprise Network section, click Authorize Cross-Account Cloud Enterprise Network.
5. Account A Attaches the Network Instance
① Log on to the Cloud Enterprise Network console using Account A.
② On the Cloud Enterprise Network Instances page, click Manage under the Actions column of the created Cloud Enterprise Network instance.
③ On the Attach Network Instance page, click Attach Network Instance to attach the VPC network in the same region under Account B.
6. Open Ports on the Accounts (Important)
① On the Security Groups list page, click Configure Rules.
② Manually add inbound rules.
At this point, the network configuration for our ECS instances is complete. You can log on to the instances and ping the respective IPs to verify connectivity.
Note: All three instances must have ports opened and be joined to the Cloud Enterprise Network. I only used two for testing here.
Tip: If the configuration fails, simply call Alibaba Cloud support. A dedicated support engineer will provide one-on-one assistance—and you might even get to chat with a friendly expert!
2. Configure Passwordless SSH Login
1. Disable SELinux and Firewall
To permanently disable SELinux, modify the /etc/sysconfig/selinux configuration file:
To permanently disable the firewall so it does not start automatically after a reboot, use the command:
By default, Alibaba Cloud ECS instances have SELinux and the firewall automatically disabled.
2. Configure IP Mapping
Edit the /etc/hosts file:
Edit the /etc/hostname file:
Remember to reboot for the changes to take effect. This step is not mandatory, but I did it because using hostnames in subsequent operations is much more convenient.
3. Configure Passwordless SSH Login for the Three Hosts
Generate public and private keys:
After running the following command, press "Enter" until the public key is generated when prompted.
This needs to be performed on all three hosts. Then combine the keys and distribute them to each host. Finally, remember to verify with SSH.
3. Upload the GBase Installation Package to ECS Instances
1. Upload the Installation Package
There are many methods. I used SCP:
2. Extract the Installation Package
3. Add Swap Space
Since ECS instances do not have swap space configured, we need to set it up manually; otherwise, the installation will fail.
◆ Create a swap file
◆ Convert the partition format
◆ Modify partition file permissions
◆ Mount the swap space
The mount settings above will be lost after a system reboot. To avoid this, edit /etc/fstab.
Append the following content to the /etc/fstab file.
4. Install the GBase 8a Cluster
1. Navigate to the gcinstall Directory and Edit the demo.options File
Configuration is as follows:
2. Run the Installation Script
Just press 'y' for all prompts, and the installation will succeed:
3. After Installation, Verify the Cluster Health—All Five Processes Should Be Running
All five processes are running normally:
service gcware status:
4. Data Distribution
Switch to the gbase user and navigate to the /opt/gcinstall directory to perform data distribution. Here, I chose 2 shards per node, with 2 replicas for each shard. (The pattern 1 can be omitted.)
Use the command: gcadmin showdistribution node to view the shard replicas. As you can see, setting 2 replicas across 3 nodes essentially means you have 3 copies of the data, which is highly secure.
5. Database Initialization
Switch to the gbase user and enter the GBase database using the command gccli -uroot -p. Just press Enter when prompted for the password.
Run the initnodedatamap command to successfully initialize the database. After that, you are free to explore!
Bonus Tip: If you’ve made it this far, you’ve probably completed the setup! Here’s a bonus: if a service fails to start, first check whether its corresponding port is open.
5. Summary
The biggest challenge during this installation was networking. Unlike an on-premises setup, ECS cloud servers require manual network interconnection and opening the appropriate ports. Additionally, the initial installation failed due to memory exceeding the maximum limit. After configuring swap space, the installation succeeded.