Commit d68dc957 by inrgihc

修正docker部署脚本

parent e652abee
......@@ -127,7 +127,13 @@ sh ./docker-maven-build.sh
(1) 当编译打包完成后,会在sqlrest/target/目录下生成sqlrest-relase-x.x.x.tar.gz的打包文件,将文件拷贝到已安装JRE的部署机器上解压即可。
(2) 基于docker-compose提供linux联网环境下的**一键安装**,安装命令见 [发行版链接地址](https://gitee.com/inrgihc/sqlrest/releases)
(2) 基于docker-compose提供linux联网环境下的一键安装,x86的CentOS系统下安装命令如下:
```
curl -k -sSL https://gitee.com/inrgihc/dbswitch/attach_files/1978630/download -o /tmp/sr.sh && bash /tmp/sr.sh && rm -f /tmp/sr.sh
```
文档详见: [build-docker/install/README.md](build-docker/install)
(3) 物理机方式部署
......
......@@ -29,8 +29,21 @@ rm -f sqlrest-release.tar.gz && rm -rf sqlrest-release/lib/* && rm -rf sqlrest-r
# clean project
cd $PROJECT_ROOT_DIR && sh docker-maven-clean.sh && cd -
# tag image
docker tag inrgihc/sqlrest-manager:${SQLREST_VERSION} registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-manager:${SQLREST_VERSION}
docker tag inrgihc/sqlrest-executor:${SQLREST_VERSION} registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-executor:${SQLREST_VERSION}
docker tag inrgihc/sqlrest-gateway:${SQLREST_VERSION} registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-gateway:${SQLREST_VERSION}
# login and push docker image
docker push registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-manager:${SQLREST_VERSION}
docker push registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-executor:${SQLREST_VERSION}
docker push registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-gateway:${SQLREST_VERSION}
docker tag registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-manager:${SQLREST_VERSION} registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-manager:latest
docker tag registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-executor:${SQLREST_VERSION} registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-executor:latest
docker tag registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-gateway:${SQLREST_VERSION} registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-gateway:latest
docker push registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-manager:latest
docker push registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-executor:latest
docker push registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-gateway:latest
echo 'success'
version: '3.3'
services:
mysqldb:
container_name: sqlrest_mysqldb
image: mysql:5.7
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/mysql:5.7
network_mode: host
volumes:
- "/data/mysql:/var/lib/mysql"
......@@ -19,7 +20,7 @@ services:
start_period: 30s
manager:
container_name: sqlrest_manager
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-manager:1.0.0
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-manager:latest
network_mode: host
environment:
MYSQLDB_HOST: localhost
......@@ -32,7 +33,7 @@ services:
EXECUTOR_PORT: 8092
GATEWAY_PORT: 8091
volumes:
- /tmp:/tmp
- /tmp:/tmp
ports:
- 8090:8090
depends_on:
......@@ -40,7 +41,7 @@ services:
condition: service_healthy
executor:
container_name: sqlrest_executor
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-executor:1.0.0
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-executor:latest
network_mode: host
environment:
MYSQLDB_HOST: localhost
......@@ -53,7 +54,7 @@ services:
EXECUTOR_PORT: 8092
GATEWAY_PORT: 8091
volumes:
- /tmp:/tmp
- /tmp:/tmp
ports:
- 8092:8092
depends_on:
......@@ -61,7 +62,7 @@ services:
condition: service_healthy
gateway:
container_name: sqlrest_gateway
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-gateway:1.0.0
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/sqlrest-gateway:latest
network_mode: host
environment:
MYSQLDB_HOST: localhost
......@@ -74,7 +75,7 @@ services:
EXECUTOR_PORT: 8092
GATEWAY_PORT: 8091
volumes:
- /tmp:/tmp
- /tmp:/tmp
ports:
- 8091:8091
depends_on:
......
......@@ -45,7 +45,7 @@ elif [ "$module" = "executor" ]; then
APP_MAIN_CLASS='com.gitee.sqlrest.executor.ExecutorApplication'
elif [ "$module" = "gateway" ]; then
CLASSPATH="$APP_CONF_PATH/gateway:$APP_LIB_COMMON_PATH/*:$APP_HOME/lib/webflux/*:$APP_HOME/lib/gateway/*"
APP_MAIN_CLASS='ccom.gitee.sqlrest.gateway.GatewayApplication'
APP_MAIN_CLASS='com.gitee.sqlrest.gateway.GatewayApplication'
else
echo "Error: No module named '$module' was found."
exit 1
......@@ -53,7 +53,7 @@ fi
# 执行命令
[ -d "${APP_HOME}/run" ] || mkdir -p "${APP_HOME}/run"
echo "d ${APP_HOME} && $JAVA -cp $CLASSPATH $JVMFLAGS $APP_MAIN_CLASS"
echo "cd ${APP_HOME} && $JAVA -cp $CLASSPATH $JVMFLAGS $APP_MAIN_CLASS"
cd ${APP_HOME} && $JAVA -cp $CLASSPATH $JVMFLAGS $APP_MAIN_CLASS
echo "Finish start $module !"
......@@ -13,6 +13,17 @@ spring:
validation-query: SELECT 1
test-on-borrow: true
sqlrest:
cache:
hazelcast:
enabled: true
redis:
enabled: false
host: 127.0.0.1
port: 6379
password: 123456
database: 0
mybatis:
configuration:
lazy-loading-enabled: true
......
......@@ -46,6 +46,17 @@ spring:
allowed-methods: '*'
allowed-headers: "*"
sqlrest:
cache:
hazelcast:
enabled: true
redis:
enabled: false
host: 127.0.0.1
port: 6379
password: 123456
database: 0
mybatis:
configuration:
lazy-loading-enabled: true
......
......@@ -19,6 +19,17 @@ spring:
table: SQLREST_SCHEMA_HISTORY
enabled: true
sqlrest:
cache:
hazelcast:
enabled: true
redis:
enabled: false
host: 127.0.0.1
port: 6379
password: 123456
database: 0
mybatis:
configuration:
lazy-loading-enabled: true
......
......@@ -65,7 +65,7 @@ public enum ProductTypeEnum {
.urlSample("jdbc:oracle:thin:@172.17.2.10:1521:ORCL")
.sqlSchemaList("SELECT USERNAME FROM SYS.ALL_USERS")
.adapter(database -> Pair.of(null, database))
.pageSql("SELECT * FROM ( SELECT TMP.*, ROWNUM ROW_ID FROM ( %s ) ALIAS WHERE ROWNUM <= ? ) WHERE ROW_ID > ?")
.pageSql("SELECT * FROM ( SELECT ALIAS.*, ROWNUM ROW_ID FROM ( %s ) ALIAS WHERE ROWNUM <= ? ) WHERE ROW_ID > ?")
.build()),
/**
* Microsoft SQL Server数据库类型(>=2005)
......@@ -124,7 +124,7 @@ public enum ProductTypeEnum {
.sqlSchemaList("SELECT SCHEMANAME FROM SYSCAT.SCHEMATA ")
.adapter(database -> Pair.of(null, database))
.pageSql(
"SELECT * FROM (SELECT TMP_PAGE.*,ROWNUMBER() OVER() AS ROW_ID FROM ( %s ) AS TMP_PAGE) TMP_PAGE WHERE ROW_ID BETWEEN ? AND ?")
"SELECT * FROM (SELECT TMP_PAGE.*,ROWNUMBER() OVER() AS ROW_ID FROM ( %s ) AS TMP_PAGE) ALIAS WHERE ROW_ID BETWEEN ? AND ?")
.build()),
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment