Quick start (take docker as an example)
1. Enter the /home directory
Open the command window to execute:
-
Clone project
git clone --depth 1 https://github.com/nacos-group/nacos-docker.git cd nacos-docker
-
Standalone Derby
! Note that theComes with yamlFile, the example uses stand-alone mode
docker-compose -f example/standalone-derby.yaml up
The installation is complete and ready to use
-
Open the browser
link:http://ip:8848/nacos/
Other configuration files
-
Standalone Mysql
# Using mysql 5.7 docker-compose -f example/standalone-mysql-5.7.yaml up # Using mysql 8 docker-compose -f example/standalone-mysql-8.yaml up
-
Cluster mode
docker-compose -f example/cluster-hostname.yaml up
-
Service registration example
curl -X PUT 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080'
-
Service discovery example
curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instances?serviceName=nacos.naming.serviceName'
-
Push configuration example
curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=helloWorld"
-
Get configuration example
curl -X GET "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test"
-
Open the browser
link:http://127.0.0.1:8848/nacos/
Other ways to use
Open the command window to execute:
-
Clone the project and enter the project root directory
git clone https://github.com/paderlol/nacos-docker.git cd nacos-docker
-
Stand-alone
docker-compose -f standalone.yaml up
-
Cluster
docker-compose -f cluster.yaml up
-
Registration Service
curl -X PUT 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080'
-
Register configuration
curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=helloWorld"
-
Access control panel
Browser access: http://127.0.0.1:8848/nacos/