Nacos Docker

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

Nacos Standalone in Docker Compose

nacos-standalone-mysql.yaml

Nacos Cluster in Docker Compose

nacos-mysql.yaml

服务注册

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/instance/list?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"

Monitor

Prometheus query nacos_monitor

Grafana

  • Configuration -> Data Sources
    • Name: prometheus
    • URL: http://prometheus:9090/
  • Create -> Import