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

Recommend

HTML+CSS to create a top navigation bar menu

Navigation bar creation: Technical requirements: ...

Why the CSS attribute value clear:right does not work in detail

Using the clear property to clear floats is a comm...

11 Examples of Advanced Usage of Input Elements in Web Forms

1. Cancel the dotted box when the button is press...

Some tips on deep optimization to improve website access speed

<br />The website access speed can directly ...

Detailed discussion of MySQL stored procedures and stored functions

1 Stored Procedure 1.1 What is a stored procedure...

Hyperlink icon specifications: improve article readability

1. What is the hyperlink icon specification ?<...

How to perfectly implement the grid layout with intervals on the page

Typical layout examples As shown in the above pic...

Vue storage contains a solution for Boolean values

Vue stores storage with Boolean values I encounte...

Nginx cache files and dynamic files automatic balancing configuration script

nginx Nginx (engine x) is a high-performance HTTP...

MySQL 8.0.18 installation and configuration method graphic tutorial

This article records the installation and configu...

How to use mysql index merge

Index merging is an intelligent algorithm provide...

MySQL transaction control flow and ACID characteristics

Table of contents 1. ACID Characteristics Transac...

How to maintain a long connection when using nginx reverse proxy

· 【Scene description】 After HTTP1.1, the HTTP pro...

How to optimize MySQL indexes

1. How MySQL uses indexes Indexes are used to qui...

Steps to install MySQL using Docker under Linux

As a tester, you may often need to install some s...