Get the App
SLTechnology News&Howtos  ›  Database  › 

MongoDB multiple instances

Shulou Source: shulou.com Published: 2022-06-01 22:17:50 10月01日 Update

In the case of sufficient resources for a single server, multiple instances can be used to make full use of the server resources.

The steps are as follows:

The first thing you need to do is copy the configuration file as a

Then go to the backup configuration file to modify the log storage location, data file storage location, listening port, listening address.

Although we have defined the location of log files and data files, we have not created the defined directory, so we need to create the path here, but the main thing to do here is that the log files need to be given maximum permissions, otherwise an error will be reported when MongoDB is opened later.

Start using the mongod-f configuration file path. Such as mongod-f / etc/mongod2. In this way, if you look at the port, you will find that there are two ports, and the same multi-instance is complete.

We can use the mongo-- port port number to enter

Tags: File location log port storage configuration instance data server resource path service monitor sufficient maximum two slogan address backup situation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno NVidia Shulou Tech Info Apple