Common commands for deploying influxdb and mongo using docker

Common commands for deploying influxdb and mongo using docker

Deploy database based on docker

sudo docker pull influxdb
sudo docker pull mongo
sudo docker run -p 27017:27017 -v xxx:/xxx --name xxxx -d mongo:latest
sudo docker run -d -p8086:8086 --name xxx influxdb:latest

Initialize the mongodb database

Enter the mongo image to configure the user password

mongo 127.0.0.1
use admin;
db.createUser({user: "xxx", pwd: "xxx", roles: [{ role: "root", db: "admin" }]});
db.getUser("xxx")

Importing Data

Enter the mongo container:

mongoimport -d aaa -c xxx.json

Check the import results:

mongo 127.0.0.1
show databases;
use aaa;
db.xxx.find();

Create the bbb database

use bbb
db
db.keynes_record.insert({"name":"test"})
show databases;

Initialize InfluxDB

Enter the docker container:

influx
CREATE DATABASE keynes
SHOW DATABASES

Summarize

The above are the common commands for deploying influxdb and mongo using docker introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time!

You may also be interested in:
  • Detailed explanation of using Elasticsearch visualization Kibana under Docker
  • Detailed explanation of the construction of Docker container visual monitoring center
  • Detailed tutorial on building a JMeter+Grafana+Influxdb monitoring platform with Docker
  • Detailed tutorial on distributed operation of jmeter in docker environment
  • Use Grafana to display monitoring charts of Docker containers and set email alert rules (illustration)
  • How to monitor Docker using Grafana on Ubuntu
  • Detailed tutorial for installing influxdb in docker (performance test)
  • Tutorial on building a JMeter+Grafana+influxdb visual performance monitoring platform in docker environment

<<:  MySQL Index Detailed Explanation

>>:  Let's talk about destructuring in JS ES6

Blog    

Recommend

About Zabbix custom monitoring items and triggers

Table of contents 1. Monitoring port Relationship...

vue_drf implements SMS verification code

Table of contents 1. Demand 1. Demand 2. SDK para...

Tutorial on installing Ubuntu 20.04 and NVIDIA drivers

Install Ubuntu 20.04 Install NVIDIA drivers Confi...

MySql inserts data successfully but reports [Err] 1055 error solution

1. Question: I have been doing insert operations ...

A brief discussion on JS prototype and prototype chain

Table of contents 1. Prototype 2. Prototype point...

This article will help you understand the life cycle in Vue

Table of contents 1. beforeCreate & created 2...

Talking about ContentType(s) from image/x-png

This also caused the inability to upload png files...

HTML form value transfer example through get method

The google.html interface is as shown in the figur...

Detailed introduction and usage examples of map tag parameters

Map tags must appear in pairs, i.e. <map> .....

Teach you how to use docker-maven-plugin to automate deployment

1. Introduction to docker-maven-plugin In our con...

CentOS 6-7 yum installation method of PHP (recommended)

1. Check the currently installed PHP packages yum...

Detailed explanation of TypeScript 2.0 marked union types

Table of contents Constructing payment methods us...