Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,19 @@ IoTDB-Workbench是IoTDB的可视化管理工具,可对IoTDB的数据进行增

## Docker

`docker-compose up -d`
1、构建镜像:将前后后端分别打包构建出target和dist目录,然后在对应的目录下执行命令(当docker hub 有下面镜像时可以省去构建镜像步骤)

```shell script
cd bacnkend
docker build -t apache/iotdb-web-workbench:0.13.0-backend .
cd frontend
docker build -t apache/iotdb-web-frontend:0.13.0-frontend .
```

2、将backend/resources/sqlite目录下的iotdb拷贝到你需要挂载的路径,如/data/iotdb.db

3、在根目录下执行

`docker-compose up -d`

> 注意 docker-compose.yml中volumes挂载路径为步骤2中所指定路径;PORTS和你后端端口的值一样。
12 changes: 6 additions & 6 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# specific language governing permissions and limitations
# under the License.
#
FROM openjdk:8-jdk-oracle

ENV JAVA_MEM_OPTS="-Xmx1024m -Xms1024m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m"

COPY target/*.jar /app/app.jar

RUN mkdir /data

FROM openjdk:8-jdk-oracle
EXPOSE 9090

COPY --from=builder /app/target/workbench-1.0.0.jar /app/workbench-1.0.0.jar

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "/app/workbench-1.0.0.jar"]
ENTRYPOINT ["java", "-jar", "${JAVA_MEM_OPTS}","/app/app.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Component;


@Component
public interface ViewModeMapper extends BaseMapper<ViewMode> {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import java.util.List;


@Data
public class QueryInfoDTO {
private Long latestRunningTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.io.Serializable;


@Data
public class MetricsConnectionVO implements Serializable {
Integer id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.io.Serializable;


@Data
public class MetricsListDataVO implements Serializable {
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import lombok.Data;


@Data
public class QueryClassificationVO {
private Integer id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1559,13 +1559,19 @@ public List<MetricsListDataVO> getMemMetricsDataList(Connection connection) thro
public List<MetricsListDataVO> getDiskMetricsDataList(Connection connection)
throws BaseException {
List<MetricsListDataVO> list = new ArrayList<>();
list.add(getDiskTotalSize(connection));
list.add(getDiskLoadSize(connection));
list.add(getDiskAvailableSize(connection));
list.add(getDiskIO(connection));
list.add(getWalFileCountAndSize(connection));
list.add(getSeqTSFileCountAndSize(connection));
list.add(getUnSeqTSFileCountAndSize(connection));

try {
list.add(getDiskTotalSize(connection));
list.add(getDiskLoadSize(connection));
list.add(getDiskAvailableSize(connection));
list.add(getDiskIO(connection));
list.add(getWalFileCountAndSize(connection));
list.add(getSeqTSFileCountAndSize(connection));
} catch (Exception e) {
e.printStackTrace();
return list;
}

return list;
}

Expand Down
Binary file modified backend/src/main/resources/sqlite/iotdb.db
Binary file not shown.
13 changes: 8 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@
# under the License.
#


version: "3.8"

services:
backend:
build: ./backend
image: apache/iotdb-web-workbench:0.13.0-backend
restart: always
ports:
- 8081:8080
volumes:
- /data/iotdb.db:/data/iotdb.db #���ݿ����ǰ��Ϊ����·��

frontend:
build: ./frontend
image: apache/iotdb-web-workbench:0.13.0-frontend
restart: always
ports:
- 8080:8080
- 8081:80 #���ʶ˿�
environment:
- BACKEND_ADDRESS=backend:9090 #��������˿�
depends_on:
- backend
30 changes: 8 additions & 22 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,13 @@
# under the License.
#

FROM node:lts-alpine

# From official Vue Documentation https://vuejs.org/v2/cookbook/dockerize-vuejs-app.html

# install simple http server for serving static content
RUN npm install -g http-server
FROM nginx:1.20-alpine

# make the 'app' folder the current working directory
WORKDIR /app

# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./

# install project dependencies
RUN npm install

# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .

# build app for production with minification
RUN npm run build

EXPOSE 8080
CMD [ "http-server", "dist" ]
ENV BACKEND_ADDRESS=backend:9090
COPY nginx.conf /etc/nginx/conf.d/
RUN rm -rf /usr/share/nginx/html/*
COPY dist/ /usr/share/nginx/html/
WORKDIR /etc/nginx/conf.d
ENTRYPOINT envsubst '$BACKEND_ADDRESS' < nginx.conf > default.conf &&rm nginx.conf && nginx -g 'daemon off;'
EXPOSE 80
30 changes: 30 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
server {
listen 80;
# server_name /;
root /usr/share/nginx/html;
index index.html index.htm;
# redirect server error pages to the static page /50x.html
# error_page 500 503 504 /50x.html;

# 设置客户端最大可发送的body大小
client_max_body_size 400m;

# 解决504 Gateway Timeout错误
# Proxy方式:http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass
proxy_buffers 8 128k;
proxy_connect_timeout 3000;
proxy_read_timeout 3000;
proxy_send_timeout 3000;
# 发送超时设置,两次发送间隔超过报错
send_timeout 3000;

# vue router配置
location / {
try_files $uri $uri/ /index.html;
}

# 正式版配置
location /api {
proxy_pass http://${BACKEND_ADDRESS}/api;
}
}