Use Docker, navicat to deploy and connect GaussDB

1. Install Docker tool on CentOS7

1. Uninstall the previous version of Docker

yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine \
                  docker-ce

 2. Install Docker

First, the virtual machine must be connected to the Internet and install the yum tool

yum install -y yum-utils \
           device-mapper-persistent-data \
           lvm2 --skip-broken

Then update the local mirror source:

# 设置docker镜像源
yum-config-manager \
    --add-repo \
    https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    
sed -i 's/download.docker.com/mirrors.aliyun.com\/docker-ce/g' /etc/yum.repos.d/docker-ce.repo
 
yum makecache fast

Then enter the command:

yum install -y docker-ce

docker-ce is a free version for the community. Wait for a while, docker will be installed successfully.

3. Start Docker

systemctl start docker  # 启动docker服务
 
systemctl stop docker  # 停止docker服务
 
systemctl restart docker  # 重启docker服务

4. Configure mirror acceleration

Refer to Alibaba Cloud's mirror acceleration document: https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://v5np4yet.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

2. Use Docker to deploy GaussDB

1. Pull the gauss image

docker pull enmotech/opengauss

2. Create and run the container

docker run --name opengauss1 --privileged=true -p 5432:5432 -d -e GS_PASSWORD=Bls@123456 enmotech/opengauss:latest
docker ps

 Generally used connection user gaussdb , password is Bls@123456

3. Open port 5432

firewall-cmd --zone=public --add-port=5432/tcp --permanent
firewall-cmd --reload

3. Use Navicat to connect GaussDB

1. Find the PostgreSQL... connection in navicat

 2. Fill in the information to connect

 

Guess you like

Origin blog.csdn.net/yueyue763184/article/details/129294369