# Nacos Docker
![Docker Pulls](https://img.shields.io/docker/pulls/nacos/nacos-server.svg?maxAge=60480)
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 下载量 138 浏览量
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
资源推荐
资源详情
资源评论
收起资源包目录
基于分布式事务seata+分库分表shardingspherejdbc+nacos+dubbo项目源码.zip (259个子文件)
io.seata.server.coordinator.AbstractCore 157B
seata-server.bat 3KB
changlog 79B
file.conf 1KB
registry.conf 533B
root.data 0B
root.data 0B
io.seata.core.store.db.DataSourceGenerator 92B
Dockerfile 2KB
Dockerfile 1KB
nacos-hostname.env 229B
nacos-ip.env 224B
nacos-standlone-mysql.env 219B
mysql.env 91B
file.conf.example 3KB
.gitignore 159B
netty-all-4.1.30.Final.jar 3.71MB
druid-1.1.12.jar 2.64MB
guava-27.0.1-jre.jar 2.62MB
mysql-connector-java-8.0.19.jar 2.25MB
mysql-connector-java-8.0.19.jar 2.25MB
ant-1.10.6.jar 2.14MB
h2-1.4.181.jar 1.61MB
protobuf-java-3.7.1.jar 1.36MB
jackson-databind-2.9.9.jar 1.29MB
netty-3.10.6.Final.jar 1.23MB
jetcd-core-0.3.0.jar 1.2MB
proto-google-common-protos-1.0.0.jar 1.04MB
commons-math-2.2.jar 965KB
mysql-connector-java-5.1.35.jar 946KB
zookeeper-3.4.14.jar 890KB
hessian-4.0.63.jar 878KB
httpclient-4.5.8.jar 754KB
grpc-core-1.17.1.jar 730KB
javassist-3.21.0-GA.jar 718KB
postgresql-42.1.4.jar 696KB
guice-4.1.0.jar 658KB
fastjson-1.2.60.jar 637KB
seata-serializer-protobuf-1.2.0.jar 611KB
commons-compress-1.19.jar 601KB
xstream-1.4.10.jar 576KB
joda-time-2.3.jar 568KB
jedis-2.9.0.jar 541KB
log4j-1.2.17.jar 478KB
logback-core-1.2.0.jar 462KB
antlr-2.7.7.jar 435KB
eureka-client-1.9.5.jar 429KB
jersey-core-1.19.1.jar 427KB
commons-lang3-3.4.jar 424KB
hessian-3.3.6.jar 402KB
fst-2.57.jar 387KB
commons-configuration-1.8.jar 346KB
kryo-4.0.2.jar 330KB
commons-codec-1.11.jar 327KB
httpcore-4.4.11.jar 319KB
jackson-core-2.9.10.jar 318KB
opencensus-api-0.17.0.jar 315KB
logback-classic-1.2.0.jar 303KB
snakeyaml-1.23.jar 294KB
commons-jxpath-1.3.jar 293KB
commons-lang-2.6.jar 278KB
bolt-1.4.6.jar 230KB
gson-2.8.2.jar 227KB
nacos-client-1.2.0.jar 226KB
servo-core-0.12.21.jar 221KB
config-1.2.1.jar 214KB
grpc-netty-1.17.1.jar 207KB
seata-core-1.2.0.jar 205KB
commons-dbcp2-2.7.0.jar 204KB
checker-qual-2.5.2.jar 189KB
commons-io-2.2.jar 170KB
dexx-collections-0.2.jar 162KB
antlr-runtime-3.4.jar 161KB
consul-api-1.4.2.jar 157KB
seata-server-1.2.0.jar 152KB
apollo-client-1.1.0.jar 149KB
stringtemplate-3.2.1.jar 145KB
grpc-grpclb-1.17.1.jar 144KB
archaius-core-0.7.6.jar 136KB
jersey-client-1.19.1.jar 131KB
sofa-common-tools-1.0.12.jar 117KB
commons-pool2-2.4.2.jar 109KB
registry-client-all-5.2.0.jar 109KB
commons-pool-1.6.jar 109KB
xz-1.8.jar 106KB
kryo-serializers-0.42.jar 104KB
servlet-api-2.5.jar 103KB
netflix-infix-0.3.0.jar 99KB
jline-0.9.94.jar 85KB
jettison-1.3.7.jar 82KB
apollo-core-1.1.0.jar 75KB
zkclient-0.11.jar 73KB
jcommander-1.72.jar 68KB
netflix-eventbus-0.3.0.jar 67KB
protobuf-java-util-3.5.1.jar 67KB
jackson-annotations-2.9.4.jar 65KB
commons-logging-1.2.jar 60KB
simpleclient-0.5.0.jar 58KB
lookout-api-1.5.2.jar 55KB
objenesis-2.6.jar 54KB
共 259 条
- 1
- 2
- 3
资源评论
武昌库里写JAVA
- 粉丝: 3136
- 资源: 1872
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功