Installing openGauss Database on openEuler 22.03 in VMware

Installing openEuler 22.03

Creating the Virtual Machine

Configure the following settings when creating your VM:

  1. Select Custom installation
  2. Choose your ISO file as the boot media
  3. Set guest operating system to Linux, version Other Linux 5.x kernel 64-bit
  4. Assign a name to your virtual machine
  5. Processor configuration: 1 processor with 4 cores
  6. Allocate 8GB RAM to the VM
  7. Use NAT network mode
  8. Select LSI Logic for the I/O controller
  9. Set disk type to SCSI
  10. Choose Create a new virtual disk
  11. Configure disk capacity according to your needs and proceed with defaults

Installing openEuler

  1. Select Chinese language during installation

  2. Choose Automatic partitioning at installation destination

  3. Set the root password

  4. In software selection, choose Server workload and include:

    • openGauss database
    • Hardware monitoring tools
    • Performance tools
    • Linux remote management
    • Windows file servers
    • Development tools
    • Terminal system management tools
    • Traditional UNIX compatibility
    • Security tools
    • System tools

    Important: Avoid minimal installation, otherwise essential utilities like ifconfig and tar will be unavailable.

  5. Click Install and wait for completion

Configuring Network Environment

Step 1: Identify NAT Gateway

In VMware, select VMnet8 and click NAT Settings. Record the Gateway IP address displayed.

Step 2: Configure Network in VM

Edit the network configuration file:

vi /etc/sysconfig/network-scripts/ifcfg-ens33

Apply these modifications:

BOOTPROTO=static
GATEWAY=192.168.137.2
IPADDR=192.168.137.100
DNS1=114.114.114.114

Verify the configuration:

ifconfig

Step 3: Configure Windows Host Adapter

In Windows, access VMnet8 adapter properties and set IPv4 to match the gateway configuration from Step 1.

Step 4: Disable Firewall on Windows

  1. Open Windows Defender FirewallAdvanced Settings
  2. Check the Public Profile column — all profiles must show green checkmarks
  3. Verify Inbound Rules allow necessary traffic

Step 5: Disable Firewall on Linux

systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

Step 6: Disable SELinux Permanently

vim /etc/sysconfig/selinux

Change the line to:

SELINUX=disabled

Step 7: Verify Connectivity

Test ping between host and VM to confirm network configuration is working.


Installing openGauss

Since openGauss was included during system installation, the opengauss user account should already exist.

Configuring openGauss

Step 1: Switch too openGauss User

su - opengauss

Step 2: Modify postgresql.conf

vim /var/lib/opengauss/data/postgresql.conf

Update these parameters:

listen_addresses = '*'
local_bind_address = '192.168.137.100'
port = 5432
password_encryption_type = 0

Step 3: Update pg_hba.conf

vim /var/lib/opengauss/data/pg_hba.conf

Add the following line at the end:

host    all     all      0.0.0.0/0      md5

Step 4: Restart openGauss

/usr/local/opengauss/bin/gs_ctl restart

Creating Database Users

Step 1: Connect to openGauss

gsql -d postgres -p 5432

Step 2: Update openGauss User Password

ALTER USER opengauss IDENTIFIED BY "SecurePassword123";

Step 3: Create Test User

The default opengauss user does not support remote connections. Create a new user instead:

CREATE USER testuser IDENTIFIED BY 'TestPassword456';

Step 4: Grant Administrator Privileges

ALTER USER testuser SYSADMIN;

Step 5: Exit

\q

Connecting via Navicat

  1. Click Connection → select PostgreSQL
  2. Enter the following connection details:
    • Connection Name: Customize as needed
    • Host: VM IP address (e.g., 192.168.137.100)
    • Port: 5432
    • Username: testuser
    • Password: TestPassword456
  3. Click Test Connection — a successful connection should complete instantly

Note: Ensure the openGauss service is running before attempting to connect.

Tags: openGauss OpenEuler VMware Database Installation Linux

Posted on Mon, 22 Jun 2026 18:30:02 +0000 by Shaun13