操作步骤
-
Clone 项目
git clone https://github.com/nacos-group/nacos-docker.git cd nacos-docker (如果提示-bash: git: command not found 解决方法: Centos下使用:yum install git -y Ubuntu/Debian下使用 : apt-get install git -y)
-
单机模式 Mysql
docker-compose -f example/standalone-mysql.yaml up
-
集群模式
docker-compose -f example/cluster-hostname.yaml up
-
服务注册
curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080'
-
服务发现
curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instances?serviceName=nacos.naming.serviceName'
-
发布配置
curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=helloWorld"
-
获取配置
curl -X GET "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test"
-
查看日志
docker-compose -f example/standalone-mysql.yaml logs -f
-
Nacos 控制台
link:http://ip:8848/nacos/ 账号nacos 密码nacos