Use Docker compose the cluster to build nacos

Use Docker compose the cluster to build nacos


1, pull docker nacos warehouse

Access nacos git repository
to download the project, or directly pull over

git clone https://github.com/nacos-group/nacos-docker.git

Directory structure is as follows, build is to build some of the required documents

env variables set

example is the orchestration script
Here Insert Picture Description

2, directly build a test cluster nacos

Proceed to the next example directory
Here Insert Picture Description

There are so many files

cluster-hostname.yamlHostname to run the cluster
cluster-ip.yamlto run a cluster ip
standalone-derby.yamlbe a stand-alone start by derby embedded database
standalone-mysql-5.7.yamlfor standalone started by mysql 5.7
standalone-mysql-8.yamlfor standalone start by mysql 8

Select a way you want to run, and then modify the file name docker-compose.yamlordocker-compose.yml

Then the example folder instead nacos, because the name is the name of the folder layout


Nacos into the directory, then run, hostname here to form the cluster as an example

docker-compose -f docker-compose.yaml up -d

Here Insert Picture Description

3, docker-compose not run problem-solving

Given as follows

ERROR:
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml

Here Insert Picture Description
This is because you must be in the directory and file name that you need to run must be docker-compose.yml or docker-compose.yaml
otherwise inoperable, can only start

4, to see if a successful start

He assigned the default port is 884,888,498,850, a random access can see the cluster to build success

http://localhost:8848/nacos

Published 455 original articles · won praise 1357 · Views 2.38 million +

Guess you like

Origin blog.csdn.net/qq_15071263/article/details/104801340