Merge pull request #323 from nacos-group/optimize_starter_shell
fix some issue
This commit is contained in:
commit
5ddfd0fa91
10
README.md
10
README.md
@ -6,6 +6,16 @@ This project contains a Docker image meant to facilitate the deployment of [Naco
|
||||
|
||||
[**中文**](README_ZH.md)
|
||||
|
||||
## Note
|
||||
|
||||
The following environment variables have been **removed** from the default values in the new version(**Nacos 2.2.1**)
|
||||
for the sake of **system security**, please add them yourself when starting up, otherwise an error will be reported at
|
||||
startup.
|
||||
|
||||
1. ~~NACOS_AUTH_IDENTITY_KEY~~
|
||||
2. ~~NACOS_AUTH_IDENTITY_VALUE~~
|
||||
3. ~~NACOS_AUTH_TOKEN~~
|
||||
|
||||
## Project directory
|
||||
|
||||
* build:Nacos makes the source code of the docker image
|
||||
|
10
README_ZH.md
10
README_ZH.md
@ -2,6 +2,14 @@
|
||||
|
||||
本项目是 [Nacos](https://github.com/alibaba/nacos) Server的docker镜像的build源码,以及Nacos server 在docker的单机和集群的运行例子.
|
||||
|
||||
## 注意
|
||||
|
||||
从Nacos 2.2.1开始为了系统安全考虑**移除**了以下环境变量的默认值,启动时请自行添加,否则会启动报错.
|
||||
|
||||
1. ~~NACOS_AUTH_IDENTITY_KEY~~
|
||||
2. ~~NACOS_AUTH_IDENTITY_VALUE~~
|
||||
3. ~~NACOS_AUTH_TOKEN~~
|
||||
|
||||
## 项目目录
|
||||
|
||||
* build:nacos 镜像制作的源码
|
||||
@ -129,7 +137,7 @@
|
||||
## 属性配置列表
|
||||
|
||||
| 属性名称 | 描述 | 选项 |
|
||||
| --------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------ |
|
||||
|-----------------------------------------|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| MODE | 系统启动方式: 集群/单机 | cluster/standalone 默认 **cluster** |
|
||||
| NACOS_SERVERS | 集群地址 | p1:port1空格ip2:port2 空格ip3:port3 |
|
||||
| PREFER_HOST_MODE | 支持IP还是域名模式 | hostname/ip 默认**IP** |
|
||||
|
@ -85,13 +85,13 @@ JAVA_OPT="${JAVA_OPT} -Dnacos.member.list=${MEMBER_LIST}"
|
||||
|
||||
JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([0-9]*).*$/\1/p')
|
||||
if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]]; then
|
||||
JAVA_OPT="${JAVA_OPT} -cp .:${BASE_DIR}/plugins/cmdb/*.jar:${BASE_DIR}/plugins/mysql/*.jar"
|
||||
JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${BASE_DIR}/logs/nacos_gc.log:time,tags:filecount=10,filesize=102400"
|
||||
else
|
||||
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${BASE_DIR}/plugins/health:${BASE_DIR}/plugins/cmdb:${BASE_DIR}/plugins/mysql"
|
||||
JAVA_OPT_EXT_FIX="-Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext"
|
||||
JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
|
||||
fi
|
||||
|
||||
JAVA_OPT="${JAVA_OPT} -Dloader.path=${BASE_DIR}/plugins,${BASE_DIR}/plugins/health,${BASE_DIR}/plugins/cmdb,${BASE_DIR}/plugins/selector"
|
||||
JAVA_OPT="${JAVA_OPT} -Dnacos.home=${BASE_DIR}"
|
||||
JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/target/nacos-server.jar"
|
||||
JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
|
||||
|
3
env/nacos-embedded.env
vendored
3
env/nacos-embedded.env
vendored
@ -7,3 +7,6 @@ MYSQL_SERVICE_DB_NAME=nacos_devtest
|
||||
MYSQL_SERVICE_PORT=3306
|
||||
MYSQL_SERVICE_USER=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
NACOS_AUTH_IDENTITY_KEY=2222
|
||||
NACOS_AUTH_IDENTITY_VALUE=2xxx
|
||||
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789
|
5
env/nacos-hostname.env
vendored
5
env/nacos-hostname.env
vendored
@ -1,4 +1,3 @@
|
||||
#nacos dev env
|
||||
PREFER_HOST_MODE=hostname
|
||||
NACOS_SERVERS=nacos1:8848 nacos2:8849 nacos3:8850
|
||||
SPRING_DATASOURCE_PLATFORM=mysql
|
||||
@ -8,3 +7,7 @@ MYSQL_SERVICE_PORT=3306
|
||||
MYSQL_SERVICE_USER=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
NACOS_AUTH_IDENTITY_KEY=2222
|
||||
NACOS_AUTH_IDENTITY_VALUE=2xxx
|
||||
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
SPRING_DATASOURCE_PLATFORM=mysql
|
4
env/nacos-ip.env
vendored
4
env/nacos-ip.env
vendored
@ -7,3 +7,7 @@ MYSQL_SERVICE_PORT=3306
|
||||
MYSQL_SERVICE_USER=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
NACOS_AUTH_IDENTITY_KEY=2222
|
||||
NACOS_AUTH_IDENTITY_VALUE=2xxx
|
||||
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
SPRING_DATASOURCE_PLATFORM=mysql
|
4
env/nacos-standlone-mysql.env
vendored
4
env/nacos-standlone-mysql.env
vendored
@ -7,3 +7,7 @@ MYSQL_SERVICE_PORT=3306
|
||||
MYSQL_SERVICE_USER=nacos
|
||||
MYSQL_SERVICE_PASSWORD=nacos
|
||||
MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
NACOS_AUTH_IDENTITY_KEY=2222
|
||||
NACOS_AUTH_IDENTITY_VALUE=2xxx
|
||||
NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
SPRING_DATASOURCE_PLATFORM=mysql
|
@ -1 +1 @@
|
||||
NACOS_VERSION=v2.2.1
|
||||
NACOS_VERSION=test
|
||||
|
@ -9,8 +9,8 @@ services:
|
||||
ports:
|
||||
- "7848:7848"
|
||||
- "8848:8848"
|
||||
- "9848:9848"
|
||||
- "9849:9849"
|
||||
- "9868:9848"
|
||||
- "9850:9849"
|
||||
env_file:
|
||||
- ../env/nacos-embedded.env
|
||||
restart: always
|
||||
@ -24,8 +24,8 @@ services:
|
||||
ports:
|
||||
- "7849:7848"
|
||||
- "8849:8848"
|
||||
- "9849:9848"
|
||||
- "9850:9849"
|
||||
- "9869:9848"
|
||||
- "9851:9849"
|
||||
env_file:
|
||||
- ../env/nacos-embedded.env
|
||||
restart: always
|
||||
@ -38,8 +38,8 @@ services:
|
||||
ports:
|
||||
- "7850:7848"
|
||||
- "8850:8848"
|
||||
- "9850:9848"
|
||||
- "9851:9849"
|
||||
- "9870:9848"
|
||||
- "9852:9849"
|
||||
env_file:
|
||||
- ../env/nacos-embedded.env
|
||||
restart: always
|
||||
|
@ -9,8 +9,8 @@ services:
|
||||
ports:
|
||||
- "7848:7848"
|
||||
- "8848:8848"
|
||||
- "9848:9848"
|
||||
- "9849:9849"
|
||||
- "9868:9848"
|
||||
- "9850:9849"
|
||||
env_file:
|
||||
- ../env/nacos-hostname.env
|
||||
restart: always
|
||||
@ -27,8 +27,8 @@ services:
|
||||
ports:
|
||||
- "7849:7848"
|
||||
- "8849:8848"
|
||||
- "9849:9848"
|
||||
- "9850:9849"
|
||||
- "9869:9848"
|
||||
- "9851:9849"
|
||||
env_file:
|
||||
- ../env/nacos-hostname.env
|
||||
restart: always
|
||||
@ -44,8 +44,8 @@ services:
|
||||
ports:
|
||||
- "7850:7848"
|
||||
- "8850:8848"
|
||||
- "9850:9848"
|
||||
- "9851:9849"
|
||||
- "9870:9848"
|
||||
- "9852:9849"
|
||||
env_file:
|
||||
- ../env/nacos-hostname.env
|
||||
restart: always
|
||||
|
Loading…
Reference in New Issue
Block a user