Installation
Tags: opengauss
Published: 2023-03-13 04:11:26

**Prerequisites**
**·** A user group and a common user have been created.
**·** All the server OSs and networks are functioning properly.
**·** You must have the read, write, and execute permissions on the decompression directory, installation directory, and data directory of the database installation package. The installation directory and data directory must be empty, and the installation directory, data directory, and log directory cannot overlap.
**·** You have the execute permission on the downloaded openGauss Lite package.
**·** Before the installation, check whether the specified port is occupied. If the port is occupied, change the port or stop the process that uses the port.
**·** Environment variables: Ensure that GAUSSHOME, GAUSSDATA, GAUSSLOG, and GAUSSENV do not exist during new installation. If subsequent operations such as configuration and startup are performed, ensure that these environment variables are properly configured.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0x43uw457el7z65t22bh.png)

**Procedure**
1. Log in to the host where the openGauss Lite is installed as a common user and decompress the Lite package to the installation directory.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3mw7z3hwkrgc0uvd7rs.png)

2. Assume that the decompressed package is stored in the **/opt/software/openGauss** directory. Go to the directory generated after the decompression.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17aiphsj8t1xm1ic19gk.png)

3. Run the install.sh script to install the openGauss Lite installation package.

For standalone installation: echo password | sh ./install.sh --mode single -D ~/openGauss/data -R ~/openGauss/install  --start
For primary/standby installation:
    1. On the primary node: echo password | sh ./install.sh --mode primary -D ~/openGauss/data -R ~/openGauss/install  -C "replconninfo1='localhost=ip1 localport=port1 remotehost=ip2 remoteport=port2'" --start
    2. On the standby node: echo password | sh ./install.sh --mode standby -D ~/openGauss/data -R ~/openGauss/install  -C "replconninfo1='localhost=ip1 localport=port1 remotehost=ip2 remoteport=port2'" --start

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dz2jn7vy1a02f1jxngmc.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlno6mbszega0akqpnif.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8yvyxyeu9zcp1etqx2b.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ib32chfe8rw5mwtk0mv1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/myhh5b45lh43kw1v6wqu.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/toftoerz2pe26j9cj9t0.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5c86n72swelgt3etsks.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m9p7kqprxgqi1s1akmmq.png)

4. After the installation is complete, check whether the process is normal by using ps and **gs_ctl**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82s7icoz5qnsxuuioczh.png)

Run the ps command to display information similar to the following:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyuww19uluwm9ltx22ng.png)

Run the **gs_ctl** command to display information similar to the following:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cwwyl2k0khiwir1oemgg.png)