GBase 8a Solution in Real-Time Data Transmission System (2)

Cong Li - Jul 24 - - Dev Community

In the previous article, we introduced the networking, configuration, and architecture of the system. This document will build on that architecture to explain how to perform installation verification.

I. Pre-Cluster Installation Check

1.1 Hardware Configuration Check

  • Verify that server hardware configurations match the hardware configuration list.
  • Ensure that server hardware is functioning correctly and can start properly.
  • Check if the RAID card configuration follows the recommended settings.

1.2 Operating System Configuration Check

  • Ensure the operating system version is the recommended one.
  • Verify that dual network card binding has been performed.
  • Check if gigabit and 10-gigabit network cards are operating at the correct speed.
  • Verify the correctness of disk partitions, including partition sizes and file system types as recommended.
  • Confirm that the firewall and SELinux services are disabled.
  • Ensure that the root password is consistent across all hosts.
  • Check if cluster-related ports are occupied on each host.
  • Verify that OS kernel parameters are set as recommended.

1.3 Disk Performance Testing

Use dd and fio disk testing tools to test disk IO performance on the /data directory. Evaluate the performance of sequential and random read/write based on the test results:

  • Write test: dd oflag=direct if=/dev/zero of=1.dat bs=2M count=200
  • Read test: dd iflag=direct if=1.dat of=/dev/null bs=2M count=200
  • Read/Write test: dd iflag=direct oflag=direct if=1.dat of=2.dat bs=2M count=200

Syntax: dd [options]

  • if=: input file (or device name).
  • of=: output file (or device name).
  • bs=bytes: block size for both read and write operations.
  • count=blocks: copy only the specified number of blocks.

1.4 Network IO Performance Testing

Use the netperf tool to test network IO performance for both gigabit and 10-gigabit networks. Evaluate the performance based on the test results. Netperf is a network performance measurement tool primarily based on TCP or UDP transmission. It works in a client/server model, where the server side is netserver, listening for connections from the client side (netperf), which initiates the network tests.

II. Cluster Installation

2.1 Upload and Extract Installation Files

Upload the cluster installation package to the /data/setup/ path on a coordinator node.
Extract the installation package in the current path:

# tar xfj GBase8a_MPP_Cluster-NoLicense-8.6.2_build43-R11-SUSE12-x86_64.tar.bz2
Enter fullscreen mode Exit fullscreen mode

2.2 Modify Installation Parameter File

Before installing the cluster, modify the installation parameter file based on actual conditions. The installation parameter file is located in the /data/setup/gcinstall/ directory after extracting the installation package, named demo.options. Modify the file as follows:

cd /data/setup/gcinstall
vim demo.options
Enter fullscreen mode Exit fullscreen mode

Hardware Configuration:

# cd gcinstall
# vi demo.options
installPrefix= <installation path>
coordinateHost= <management node IPs, separated by commas>
dataHost= <data node IPs, separated by commas>
#existCoordinateHost=
#existDataHost=
loginUser= root
loginUserPwd= '<OS root user password>'
dbaUser= gbase
dbaGroup= gbase
dbaPwd= 'gbase'
rootPwd= '<OS root user password>'
dbRootPwd=
mcastPort= 5493
Enter fullscreen mode Exit fullscreen mode

Installation Parameter Description:

  • installPrefix: Specifies the installation directory.
  • coordinateHost: List of all coordinator node IPs, separated by commas.
  • dataHost: List of all data node IPs, separated by commas.
  • existCoordinateHost: List of all existing coordinator node IPs, separated by commas. Not required for this installation.
  • existDataHost: List of all existing data node IPs, separated by commas. Not required for this installation.
  • loginUser: The user used to SSH into each cluster node and then switch to the root user to execute commands. This parameter is mandatory. The default user is root. The user group for this user must also be loginUser.
  • loginUserPwdFile: Indicates that the loginUser has different passwords across cluster nodes.
  • loginUserPwd: Indicates that the loginUser has the same password across cluster nodes. These two parameters are mutually exclusive; only one should be used based on password consistency.
  • dbaUser: The operating system username used for running the cluster. The dbaUser must match the directory specified by installPrefix. Ensure that this user has been created.
  • dbaGroup: The group name associated with the dbaUser.
  • dbaPwd: The password for the dbaUser.
  • rootPwdFile: Indicates different passwords for the root user across multiple nodes. This cannot be used simultaneously with rootPwd.
  • dbRootPwd: The root user password for the database. Not required during cluster installation; only effective during cluster upgrades, expansions, or node replacements.
  • mcastPort: Multicast port, default value is 5493. This parameter is not effective if installing using UDPU mode.
  • rootPwd: Unified password for the root user on all Linux OS nodes in the cluster.
  • coordinateHostNodeID: Supports IPV6 address input. If the cluster nodes use IPV4 addresses, this parameter is not needed.

2.3 Execute Installation

After modifying the installation parameter file, execute the installation script gcinstall.py. The command is as follows:

# ./gcinstall.py --silent=demo.options
Enter fullscreen mode Exit fullscreen mode

Parameter explanation:

  1. passwordInputMode: Specifies the method of obtaining passwords. The values can be [file, pwdsame, pwddiff].

    • file: Passwords are obtained from a file or command line parameters (default, plaintext in the file).
    • pwdsame: Passwords for all nodes are the same, entered once.
    • pwddiff: Passwords for each node are different, entered separately for each node.
  2. -a: Skips user interaction prompts during installation.

Upon successful installation, a gbase user is created on each node with the default password gbase. The installation creates the following directories:

  • /opt/gcluster on each coordinator node.
  • /opt/gnode on each data node.

Check cluster status with gcadmin:

CLUSTER STATE: ACTIVE
CLUSTER MODE: NORMAL

==================================================================
|             GBASE COORDINATOR CLUSTER INFORMATION              |
==================================================================
|   NodeName   |     IpAddress      |gcware |gcluster |DataState |
------------------------------------------------------------------
| coordinator1 |    10.20.64.29     | OPEN  |  OPEN   |    0     |
------------------------------------------------------------------
| coordinator2 |    10.20.64.30     | OPEN  |  OPEN   |    0     |
------------------------------------------------------------------
| coordinator3 |    10.20.64.31     | OPEN  |  OPEN   |    0     |
------------------------------------------------------------------

==============================================================
|               GBASE DATA CLUSTER INFORMATION               |
==============================================================
|NodeName |     IpAddress      |gnode |syncserver |DataState |
--------------------------------------------------------------
|  node1  |    10.20.64.24     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node2  |    10.20.64.25     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node3  |    10.20.64.26     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node4  |    10.20.64.27     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node5  |    10.20.64.28     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node6  |    10.20.64.29     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node7  |    10.20.64.32     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node8  |    10.20.64.33     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
|  node9  |    10.20.64.34     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
| node10  |    10.20.64.35     | OPEN |   OPEN    |    0     |
--------------------------------------------------------------
Enter fullscreen mode Exit fullscreen mode

2.4 Configure Distribution

Configure the distribution with 1 replica and 1 shard:

$ gcadmin distribution gcChangeInfo.xml p 1 d 1
Enter fullscreen mode Exit fullscreen mode

Verify data distribution with gcadmin showdistribution:

Image description

2.5 Cluster Initialization

After installing the cluster and establishing the distribution, initialize the database system before executing SQL commands. If not initialized, database operations will fail.

  1. Login to the cluster as the root user:
$ gccli -uroot -p 
Enter password: 
GBase client 8.6.1.1 build 49382. Copyright (c) 2004-2015, GBase. All Rights Reserved.
gbase>
Enter fullscreen mode Exit fullscreen mode
  1. Execute the initialization command:
gbase> initnodedatamap;
Query OK, 0 rows affected
Enter fullscreen mode Exit fullscreen mode

Note: This command should be executed only once. Re-executing it will result in the following error:

gbase> initnodedatamap;
ERROR 1707 (HY000): gcluster command error: (GBA-02CO-0004) nodedatamap is already initialized.
Enter fullscreen mode Exit fullscreen mode

The installation of GBase 8a MPP Cluster is now complete.

III. Post-Cluster Installation Validation

3.1 Starting and Stopping Cluster Services

After successfully installing the cluster, users can start and stop the gcware service on each node using the root user of the operating system with the following commands:

Starting the Service:

# service gcware start
Enter fullscreen mode Exit fullscreen mode

Stopping the Service:

# service gcware stop
Enter fullscreen mode Exit fullscreen mode

Restarting the Service:

# service gcware restart
Enter fullscreen mode Exit fullscreen mode

For coordinator nodes, the services involved are gclusterd, gcmonit, corosync, and gcrecover. For data nodes, the services involved are gbased, syncserver, and gcmonit.

Logging in and out of the Cluster:

On any node, users must use the gbase user at the command line to connect to the database using the gbase client tool. The command format is as follows:

gccli -u<username> -p<password> [-h<ipaddress>] [-P<portname>] [-D<databasename>] [--nice_time_format] [-c]
Enter fullscreen mode Exit fullscreen mode

Parameters:

  • username: The value for -u, the name of the user connecting to the database. The default name is root.
  • password: The value for -p, the password for the user connecting to the database. The default password is empty. After the first installation and login to the cluster, the root user's password needs to be changed.
  • ipaddress: The value for -h, the IP address of the cluster node to log in to. The default address is 127.0.0.1. This is an optional parameter. If multiple IP addresses are specified, gccli will enable high availability. The IP addresses are separated by commas, e.g., 192.168.100.10,192.168.100.11,192.168.100.12. When multiple cluster node IPs are specified, gccli first tries to connect to the first node IP. If it cannot establish a connection, it tries the next node, and so on. If none of the specified cluster node IPs can establish a connection, gccli will fail to connect to the cluster, and the login attempt will be unsuccessful.
  • portname: The value for -P, the port number used by the cluster. The default is 5258. This is an optional parameter.
  • databasename: The value for -D, specifies the default database to log in to (the database must exist). This is an optional parameter.
  • --nice_time_format: Specifies the display format for time. When used, the format will be displayed as n hour n min nnn.nn sec. Without this parameter, the format will be displayed as hh:mm:ss.ff. This is an optional parameter. nice_time_format can be used as follows:
    1. gccli -uroot --nice_time_format
    2. gccli -uroot --nice_time_format=1
    3. gccli -uroot --nice_time_format=0

Options 1 and 2 are equivalent, and option 3 is equivalent to not using nice_time_format.

  • -c: When using this parameter, it enables the use of hint optimization. This is an optional parameter.

3.2 Simple Operation Verification

After successfully installing and deploying the cluster, perform simple operations such as create, insert, update, and delete to verify that the cluster is functioning correctly. Examples are as follows:

Verify the create database Functionality:

gbase> create database test;
Enter fullscreen mode Exit fullscreen mode

Verify the create table Functionality:

gbase> create table test(
    a int,
    b varchar(200),
    c decimal(15,4),
    d date,
    e datetime,
    f longblob
);
Enter fullscreen mode Exit fullscreen mode

Verify the insert Functionality:

gbase> insert into test values 
    (1, 'AASSSDDD', 10922.34, now(), '2019-07-02', 'xxxxxaaaaaaassssssdddd'),
    (2, 'B', 100.01, now(), '2019-07-02', 'xxxx');
Enter fullscreen mode Exit fullscreen mode

Verify the update Functionality:

gbase> update test set c = 500.04 where a = 2;
Enter fullscreen mode Exit fullscreen mode

Verify the delete Functionality:

gbase> delete from test where a = 2;
Enter fullscreen mode Exit fullscreen mode

Verify the truncate Functionality:

gbase> truncate table test;
Enter fullscreen mode Exit fullscreen mode

Verify the drop Functionality:

gbase> drop table test;
Enter fullscreen mode Exit fullscreen mode

Verify the FTP Load Functionality:

gbase> load data infile 'ftp://gbase:gbase@192.168.58.11/gbasedata/ssbm/lineorder.tbl' 
    INTO TABLE ssbm.lineorder FIELDS TERMINATED BY '|';
Enter fullscreen mode Exit fullscreen mode

Verify the Local Load Functionality:

gbase> load data infile 'file://192.168.58.11/home/gbase/gbasedata/ssbm/lineorder.tbl' 
    INTO TABLE ssbm.lineorder FIELDS TERMINATED BY '|';
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player