MatrixDB 4 also provides a Docker running environment, and the address in hub.docker.com is https://hub.docker.com/u/matrixdb.

1. Pull the latest image from the mirror repository

Go to the home page and select matrixdb/centos7_demo:

centos7_demo

The command to pull the mirror is provided on the right side of the page:

pull_command

Execute the pull command in the terminal:

docker pull matrixdb/centos7_demo

After successful execution, you can see that the local repository already contains the latest version of the image:

$ docker images
REPOSITORY              TAG       IMAGE ID       CREATED        SIZE
matrixdb/centos7_demo   latest    65d20762cc25   19 hours ago   1.65GB

2. Create a container

Below, create a container based on the acquired image:

docker run -it -p 5432:5432 -p 8240:8240 --name mxdemo matrixdb/centos7_demo

-p parameter makes port mapping between host and container, with the purpose of connecting to the database in the container from the host. The format is -p Host port: Container port Database connection using port 5432 Use port 8240 in graphical management interface

After successful creation, use the Ctrl+P``Ctrl+Q` command to exit.

View the running container:

$ docker ps
CONTAINER ID   IMAGE                   COMMAND                  CREATED          STATUS          PORTS              NAMES
87344882d280   matrixdb/centos7_demo   "/home/mxadmin/entry…"   25 minutes ago   Up 25 minutes   22/tcp, 7000/tcp   mxdemo

3. Log in to the container and use it

1. Log in to the container

Use the docker exec command to log in to the running container:

docker exec -it mxdemo /bin/bash
2. Switch to mxadmin user
su - mxadmin

Next, you can use MatrixDB normally like the real environment:

[mxadmin@87344882d280 ~]$ psql
psql (12)
Type "help" for help.

mxadmin=#

4. Use DBeaver to connect to the database

In the host, use DBeaver to connect to the database in the container. After filling in the connection information according to the settings below, click Finish. The default password is: changeme

DBeaver DBeaver download address: https://dbeaver.io/download/

5. Use the terminal to connect to the database

If you do not want to enter the Docker container, you can execute psql in the terminal to connect to MatrixDB, provided that the psql command needs to be installed. If the psql command has been installed, open the terminal and enter:

psql -h 127.0.0.1 -p 5432 -d mxadmin -U mxadmin

After executing the above command, you will be asked to enter a password for verification. The default password is: changeme

6. Use MatrixDB graphical management interface

Use Chrome to access http://127.0.0.1:8240/, manage databases through a graphical interface, create and manage mxgate data import tasks. The default administrator password is changeme

If you want to restart the MatrixDB graphical management interface, you need to enter the Docker container and execute under the root user:

/etc/init.d/matrixdb-supervisor restart

For more information about the functions related to the graphical management interface, please refer to the document:

Kakfa access

Visualized Data Table

Kafka

7. More security configurations

For the convenience of trial use, the system allows any IP to access the database by default through username and password after installation, and the administrator password is changeme.

To ensure your data security, please be sure to modify client connection authentication, password and other security settings as needed when using it.

7.1 Modify client connection authentication

Modify the pg_hba.conf configuration file to restrict client connections. For specific rules, please refer to the document: Client Authentication

After the modification is completed, you need to reload pg_hba.conf to make it take effect.

gpstop -u

7.2 Modify password

[mxadmin@87344882d280 ~]$ psql -d postgres
psql (12)
Type "help" for help.
postgres=# alter role mxadmin with password 'mxadmin';
ALTER ROLE