From 401285e77917f12bcc0fe9400114263035f880a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=B7=E6=88=90=E4=BC=9F?= Date: Tue, 10 Dec 2024 15:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/deploy/das.md | 142 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/docs/deploy/das.md b/docs/deploy/das.md index 011af677..a55d35fa 100644 --- a/docs/deploy/das.md +++ b/docs/deploy/das.md @@ -287,3 +287,145 @@ firewall-cmd --zone=public --add-port=9000-9001/tcp --permanent firewall-cmd --reload ``` +## Nginx部署 + +### 安装nginx + +```shell +yum install nginx -y +``` + +配置文件 + +创建或编辑配置文件 `/etc/nginx/conf.d/nginx.conf`,内容如下: + +```nginx +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +server { + listen 80; + gzip on; + gzip_types text/plain application/json application/javascript application/css application/xml text/javascript text/css; + access_log /var/log/nginx/das.jsspisoft.access.log main; + server_name 0.0.0.0; + + location /api { + proxy_pass http://127.0.0.1:8080; + proxy_set_header HOST $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; + client_max_body_size 0; + proxy_read_timeout 1200s; + } + + + location / { + index index.html; + root /das/app/ui; + autoindex on; + } + + +} + +``` + +### 启动服务 + +```shell +systemctl start nginx +systemctl enable nginx +``` + + + +## DAS程序部署 + +### 程序部署 + +```shell +mkdir -p /das/app +cd /das/app +wget https://oss.jsspisoft.com/public/software/das/das.tar.gz +tar zxvf das.tar.gz +cd das +ln -s das-1.0.0-release.jar das.jar -f +``` + +### 修改配置文件 + +编辑`/das/app/das/application.yml` + +```yaml +# 日志配置 +logging: + level: + root: ERROR + com: + das: + modules: + calc: DEBUG + file: + name: /das/logs/das.log +# 服务端口 +server: + port: 8080 + +spring: +#pg配置 + datasource: + url: jdbc:postgresql://127.0.0.1:5432/das + username: das + password: zaq12WSX + data: +#redis连接配置 + redis: + host: 127.0.0.1 + database: 0 + port: 6379 + password: zaq12WSX + client-type: lettuce + +# AES密钥 +das: + aes: + key: b6967ee87b86d85a +#TD连接配置 +tdengine: + password: taosdata + url: jdbc:TAOS-RS://127.0.0.1:6041/das + username: root + +``` + +### 配置服务 + +创建服务文件`/etc/systemd/system/das.service`,内容如下: + +```systemd +[Unit] +Description=DAS Service +After=network.target + +[Service] +Type=simple +Environment=JAVA_HOME=/etc/alternatives/java_sdk +ExecStart=/usr/bin/java -Dfile.encoding=UTF-8 -jar das.jar + +WorkingDirectory=/das/app/das + +[Install] +WantedBy=multi-user.target +``` + +### 启动服务 + +```shell +systemctl daemon-reload +systemctl start das +systemctl enable das +``` +