Docker starts mysql, mongodb, redis, elasticsearch, and grafana databases

Time:2021-9-15

Docker starts mysql, mongodb, redis, elasticsearch, and grafana databases

preface:

When using the database temporarily, you can use docker to run, which can prevent the environment from being damaged by installation on the system. At the same time, using docker to start is faster than installing and configuring in the system. It can be said that it is the fastest way to install, deploy and start the database.


Docker configuration starts running MySQL

First create a directory and enter

sudo docker run -p 3306:3306 \\
--name mymysql \\
--restart=always \\
-v $PWD/conf:/etc/mysql/conf.d \\
-v $PWD/logs:/logs \\
-v $PWD/data:/var/lib/mysql \\
-e MYSQL\_ROOT\_PASSWORD=123456 \\
-d mysql:8

–Restart = always: always restart the container when it exits

MYSQL\_ ROOT\_ Password = 123456: root password

mysql:8   Using MySQL 8

-v $PWD/conf:/etc/mysql/conf.d   configuration file

-v $PWD/logs:/logs     journal

-v $PWD/data:/var/lib/mysql     data


The docker configuration starts running phpMyAdmin

docker run -d \\
  -p 8001:80 \\
  -e UPLOAD\_LIMIT=128M \\
  -e MAX\_EXECUTION\_TIME=10000 \\
  --name phpmyadmin \\
  phpmyadmin/phpmyadmin

UPLOAD\_ Limit and Max\_ EXECUTION\_ Time needs to be set


*The docker configuration starts runningMongoDB*

docker run -d \\
  -p 27017:27017 \\
  -v mongo-data:/data/db \\
  -v mongo-config:/data/configdb \\
  --name mongo \\
  -e MONGO\_INITDB\_ROOT\_USERNAME=mongoadmin \\
  -e MONGO\_INITDB\_ROOT\_PASSWORD=123123 \\
  -v /data:/mnt/data \\
  mongo

MONGO\_ INITDB\_ ROOT\_ Username user name

MONGO\_ INITDB\_ ROOT\_ Password password

mongo-data   Data directory

Mongo config configuration file directory


*The docker configuration starts runningMongo Express*

  docker run -d \\
  -p 8002:8081 \\
  --name mongo-express \\
  mongo-express

*The docker configuration starts runningRedis*

docker run -d \\
  -p 6379:6379 \\
  -v redis-data:/data \\
  --name redis \\
  redis

*The docker configuration starts runningElasticsearch*

docker run -d \\
  -p 9100:9100 -p 9200:9200 \\
  -e discovery.type=single-node \\
  -v es-data:/usr/share/elasticsearch/data \\
  -v es-log:/usr/share/elasticsearch/logs \\
  --name elasticsearch \\
  elasticsearch

*The docker configuration starts runningGrafana*

docker run -d \\
  -p 8003:3000 \\
  --link mysql:mysql \\
  --link mongo:mongo \\
  --name grafana \\
  grafana/grafana

Docker starts mysql, mongodb, redis, elasticsearch, and grafana databases

Recommended Today

Beautify your code VB (VBS) code formatting implementation code

However, vb.net does have many new functions that VB6 does not have. The automatic typesetting of code is one, which is the function we want to realize today – VB code formatting.Let’s look at the effect: Before formatting: Copy codeThe code is as follows: For i = 0 To WebBrowser1.Document.All.length – 1 If WebBrowser1.Document.All(i).tagName = […]