Docker-compose Deployment Mongodb+redis Problems encountered

Source: Internet
Author: User

REDIS+MONGODB Two db is used in demo environment, so you can use Docker Redids and MongoDB image directly, and use Docker-compose for federated deployment.

The following versions are used:

Docker: Using Yum-y install Docker

Docker-compose: use pip install Docker-compose

Mongodb:docker Pull mongodb:3.6.5

Redis:docker Pull redis:4.0.10

Docker-compose configuration file used by Docker-compose.yml:

Where MongoDB's entrypoint-initdb.d startup script file is as follows:

Precautions:

1. Installation of Docker-compose, using two installation methods, one is yum-y install Docker-compose, the second is pip install Docker-compose

Do not want to toss or must use the new version of the case, the proposal with the first kind of bar, more worry. The second can install the latest version, but will encounter a variety of library version dependencies, the most common is the version of requests dependency,

Due to the different requirements for Docker and docker-compose dependent versions, it is easiest to install their common version to support both the Docker version and the Docker-compose version.

Valueerror:timeout value Connect is Timeout (Connect=none, Read=none, Total=none), but it must is an int, float or None. Error

A relatively quick solution is:

(1). Pip uninstall Docker-compose, pip uninstall Docker, Pip Unstall requests (here is the focus, may have installed several versions of requests and must uninstall all versions)

(2). Pip install docker, pip install Docker-compose

Associating related versions automatically with PIP

2. In the toss MongoDB startup script (mainly in order to start to create the user and password), constantly modify the test docker-compose.yml configuration file, it should be noted that the top yml inside the configuration, the MongoDB/data/db folder

Mapped to local, but when the configuration file is modified to test, it is best to clean up the files generated in mongodb/data/db, and if you use docker-compose up to directly observe the log output, if the test is finished Docker-compose

Terminal, you must perform a docker-compose down operation to clean up the generated container.

The above approach, mainly to prevent the pre-modification of the configuration file has generated some cache, resulting in modification of the configuration file after the execution is still cached results

Docker-compose Deployment Mongodb+redis Problems encountered

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.