# Nacos Docker

This project contains a Docker image meant to facilitate the deployment of [Nacos](https://github.com/alibaba/nacos).
[**中文**](README_ZH.md)
## Project directory
* build:Nacos makes the source code of the docker image
* env: Environment variable file for compose yaml
* example: Docker compose example for Nacos server
## Precautions
After the latest `nacos/nacos-server:latest` image, the **database master-slave image** has been removed. For specific reasons, refer to [Removing the Master-Slave Image Configuration](https://github.com/nacos-group/nacos-docker/wiki/%E7%A7%BB%E9%99%A4%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%BB%E4%BB%8E%E9%95%9C%E5%83%8F%E9%85%8D%E7%BD%AE)
## Quick Start
Run the following command:
* Clone project
```powershell
git clone --depth 1 https://github.com/nacos-group/nacos-docker.git
cd nacos-docker
```
* Standalone Derby
```powershell
docker-compose -f example/standalone-derby.yaml up
```
* Standalone Mysql
```powershell
docker-compose -f example/standalone-mysql.yaml up
```
* Cluster
```powershell
docker-compose -f example/cluster-hostname.yaml up
```
* Service registration
```powershell
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
```powershell
curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instances?serviceName=nacos.naming.serviceName'
```
* Publish config
```powershell
curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=helloWorld"
```
* Get config
```powershell
curl -X GET "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test"
```
* Open the Nacos console in your browser
link:http://127.0.0.1:8848/nacos/
## Common property configuration
| name | description | option |
| ----------------------------- | -------------------------------------- | -------------------------------------- |
| MODE | cluster/standalone | cluster/standalone default **cluster** |
| NACOS_SERVERS | nacos cluster address | eg. ip1:port1 ip2:port2 ip3:port3 |
| PREFER_HOST_MODE | Whether hostname are supported | hostname/ip default **ip** |
| NACOS_SERVER_PORT | nacos server port | default **8848** |
| NACOS_SERVER_IP | custom nacos server ip when network was mutil-network | |
| SPRING_DATASOURCE_PLATFORM | standalone support mysql | mysql / empty default empty |
| MYSQL_SERVICE_HOST | mysql host | |
| MYSQL_SERVICE_PORT | mysql database port | default : **3306** |
| MYSQL_SERVICE_DB_NAME | mysql database name | |
| MYSQL_SERVICE_USER | username of database | |
| MYSQL_SERVICE_PASSWORD | password of database | |
| ~~MYSQL_MASTER_SERVICE_HOST~~ | The **latest** version of the image removes this attribute, using MYSQL_SERVICE_HOST | |
| ~~MYSQL_MASTER_SERVICE_PORT~~ | The **latest** version of the image removes this attribute, using MYSQL_SERVICE_PORT | default : **3306** |
| ~~MYSQL_MASTER_SERVICE_DB_NAME~~ | The **latest** version of the image removes this attribute, using MYSQL_SERVICE_DB_NAME | |
| ~~MYSQL_MASTER_SERVICE_USER~~ | The **latest** version of the image removes this attribute, using MYSQL_SERVICE_USER | |
| ~~MYSQL_MASTER_SERVICE_PASSWORD~~ | The **latest** version of the image removes this attribute, using MYSQL_SERVICE_PASSWORD | |
| ~~MYSQL_SLAVE_SERVICE_HOST~~ | The **latest** version of the image removes this attribute | |
| ~~MYSQL_SLAVE_SERVICE_PORT~~ | The **latest** version of the image removes this attribute | default :3306 |
| MYSQL_DATABASE_NUM | It indicates the number of database | default :**1** |
| JVM_XMS | -Xms | default :2g |
| JVM_XMX | -Xmx | default :2g |
| JVM_XMN | -Xmn | default :1g |
| JVM_MS | -XX:MetaspaceSize | default :128m |
| JVM_MMS | -XX:MaxMetaspaceSize | default :320m |
| NACOS_DEBUG | enable remote debug | y/n default :n |
| TOMCAT_ACCESSLOG_ENABLED | server.tomcat.accesslog.enabled | default :false |
| NACOS_AUTH_SYSTEM_TYPE | The auth system to use, currently only 'nacos' is supported | default :nacos |
| NACOS_AUTH_ENABLE | If turn on auth system | default :false |
| NACOS_AUTH_TOKEN_EXPIRE_SECONDS | The token expiration in seconds | default :18000 |
| NACOS_AUTH_TOKEN | The default token | default :SecretKey012345678901234567890123456789012345678901234567890123456789 |
| NACOS_AUTH_CACHE_ENABLE | Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay. | default : false |
## Nacos + Grafana + Prometheus
Usage reference:[Nacos monitor-guide](https://nacos.io/zh-cn/docs/monitor-guide.html)
**Note**: When Grafana creates a new data source, the data source address must be **http://prometheus:9090**
没有合适的资源?快使用搜索试试~ 我知道了~
基于分布式事务seata+分库分表shardingspherejdbc+nacos+dubbo项目源码.zip

共259个文件
jar:149个
java:36个
xml:16个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 190 浏览量
2024-02-05
19:55:16
上传
评论
收藏 41.64MB ZIP 举报
温馨提示
基于分布式事务seata+分库分表shardingspherejdbc+nacos+dubbo项目源码.zip 1. 环境准备 - nacos: `sh ./docker/nacos/startup.sh` - seata-server - 导入配置: `sh ./docker/seata-server/conf/nacos-config.sh ${nacos-address}` - 启动: `sh ./docker/seata-server/bin/seata-server.sh` - mysql - 创建数据库: `db_springcloud` - 创建 undo_log 表: `./docker/seata-server/conf/seata.sql` - 创建 demo 表: `./docs/db` 2. 配置 host - mysql.localhost - localhost - nacos.localhost 3. 启动项目 - project-services
资源推荐
资源详情
资源评论






















收起资源包目录





































































































共 259 条
- 1
- 2
- 3
资源评论


武昌库里写JAVA
- 粉丝: 8437
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 基于JSP的校园网站的设计与实现论文.doc
- 利用单片机制作简单万年历.doc
- 正确选择财务管理软件[会计实务-会计实操].doc
- 学校开展“2022年网络安全宣传周”活动方案.docx
- 系统集成-大屏监控系统使用说明书.doc
- 普通高中语文教学导向深度学习实践研究方案.doc
- 计算机网络技术模拟试题及答案(最终).doc
- 幼儿园语言文字领导小组网络图.pdf
- 网络防火墙需求分析.doc
- 在Excel中判断单元格是否包含日期【会计实务操作教程】.pptx
- 井下人员定位系统与通信联络系统.ppt
- (源码)基于C++ROS框架的机器人控制系统.zip
- 工程项目管理团队建设.ppt
- 教你如何选择合适的财务软件 .pdf
- 基于单片机的AD转换电路与程序设计.doc
- 网络分析仪E6607C操作指导.ppt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
