Detailed explanation of how to configure openGauss database in docker

Detailed explanation of how to configure openGauss database in docker

For Windows User

Using openGauss in Docker

  • Pull the openGauss image
  • Type in the console
docker pull enmotech/opengauss:latest

Waiting for download

insert image description here

Things may get stuck along the way. You can press Ctrl+C and then re-run the command to pull the image. Until all show Download complete

If you really can't download it, change the source of docker. Open the user (or User) folder in the C drive -> click on the user folder corresponding to the current user -> find the .docker folder

insert image description here

Edit daemon.json and add the address of the mirror source.

{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com","https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.12:5000"]
}

Run again in the console

docker pull enmotech/opengauss:latest

Start the Docker image

This parameter must be set when you use the openGauss image. This parameter value cannot be empty or undefined. This parameter sets the password for the openGauss database super user omm and the test user gaussdb. When openGauss is installed, the omm super user is created by default. This user name cannot be modified for the time being. The test user gaussdb is a user created in entrypoint.sh.

The openGauss image is configured with a local trust mechanism, so no password is required to connect to the database within the container. However, if you want to connect from outside the container (other hosts or other containers), you must enter a password.

The openGauss password has complexity requirements: the password must be 8 characters or more and must contain both uppercase and lowercase English letters, numbers, and special symbols

The default listener of openGauss is started on port 5432 in the container . If you want to access the database from outside the container, you need to specify the -p parameter when running docker . For example, the following command will allow access to the container database using port 15432 .

docker run --name opengauss --privileged=true -d -e GS_PASSWORD=Secretpassword@123 (here is your password) -p 15432 (port number):5432 enmotech/opengauss:latest

After the above command starts the container database normally, you can access the database through external gsql. (When copying, remember to delete the content in brackets and fill in your own password and port number. Of course, you can leave it unchanged. The port number here is 15432)

gsql -d postgres -U gaussdb -W'Secretpassword@123' -h your-host-ip -p15432

Of course, you can also connect through other software database connection software (dbms). Such as: datagrip and other software

After startup, enter docker-cli

insert image description here

If this interface is displayed, it means that the startup is successful.

insert image description here

To use OpenGauss, you need to switch to the omm account, so run su - omm

insert image description here

gsql -d postgres -U gaussdb -W'Secretpassword@123' -h your-host-ip -p15432 

insert image description here

The openGauss console is displayed, indicating that the installation is successful.

After the above command starts the container database normally, you can access the database through external gsql. (When copying, remember to delete the content in brackets and fill in your own password and port number. Of course, you can leave it unchanged. The port number here is 15432)

For Linux User

Linux users can install the Docker software through the console and use the package manager to install it. Run in console. Arch Users:

sudo pacman -S docker

Pull the openGauss image and enter it in the console

docker pull enmotech/opengauss:latest

To change the source on the Linux platform, edit the /etc/docker/daemon.json file and add the mirror source address "registry-mirrors" .

{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com","https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.12:5000"]
}

Run dokcer
The default listener of openGauss is started on port 5432 in the container . If you want to access the database from outside the container, you need to specify the -p parameter when running docker . For example, the following command will allow access to the container database using port 15432 .

docker run --name opengauss --privileged=true -d -e GS_PASSWORD=Secretpassword@123 (here is your password) -p 15432 (port number):5432 enmotech/opengauss:latest

References

https://hub.docker.com/r/enmotech/opengauss

This is the end of this article about configuring the openGauss database with docker. For more information about configuring the openGauss database with docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to connect QT to Oracle database and implement login verification
  • How to use QtSql to connect to MySql database in PyQt
  • How to use Qt to connect to MySQL database under ubuntu linux
  • Detailed tutorial on connecting to the OpenGauss database via Qt

<<:  JavaScript implements constellation query function with detailed code

>>:  Analysis of the cutting of the background image of the nine-square grid with adaptive width and height

Recommend

Vue storage contains a solution for Boolean values

Vue stores storage with Boolean values I encounte...

Summary of common commands in Dockerfile

Syntax composition: 1 Annotation information 2 Co...

Problems and solutions of using jsx syntax in React-vscode

Problem Description After installing the plugin E...

Detailed discussion of several methods for deduplicating JavaScript arrays

Table of contents 1. Set Deduplication 2. Double ...

vue cli3 implements the steps of packaging by environment

The vue project built with cli3 is known as a zer...

Small details of web front-end development

1 The select tag must be closed <select><...

Practical way to build selenium grid distributed environment with docker

Recently, I needed to test the zoom video confere...

A brief discussion on the font settings in web pages

Setting the font for the entire site has always b...

Example of utf8mb4 collation in MySQL

Common utf8mb4 sorting rules in MySQL are: utf8mb...

Detailed explanation of CocosCreator project structure mechanism

Table of contents 1. Project folder structure 1. ...

Sliding menu implemented with CSS3

Result:Implementation code: <!DOCTYPE html>...