# Hola_Task_Generate **Repository Path**: maohuiwen/hola_task_generate ## Basic Information - **Project Name**: Hola_Task_Generate - **Description**: Task____test - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-20 - **Last Updated**: 2025-05-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HOLA_TASK ## 1.系统要求 - Debian 12 - Nginx 1.26.1 - Jdk 1.8 - Mysql 8.0.35 - Redis 7.2.4 ## 2.打包步骤 ``` shell mvn clean package ``` ## 3.服务 - HolaTaskApplication 管理端,端口为18080 - HolaTaskClientApplication 客户端,端口为18081 ## 4.配置文件 #### 4.1管理端配置 - 主要配置文件: task-admin/src/main/resources/application.yml 里面不需要改东西 - 环境配置文件: - task-admin/src/main/resources/application-dev.yml: 测试环境 - task-admin/src/main/resources/application-local.yml: 开发环境 - task-admin/src/main/resources/application-prod.yml: 生产环境 - 生产环境application-prod.yml配置 - 可以改 - ```yml holatask: # 文件路径 filePath: /usr/local/fileUploadTask/ # 导出文件路径 exportFilePath: /usr/local/exportFilePathTask/ # AWS S3 URL路径 awsS3Url: https://assets.holatask.com/ ``` - ```yml server: # 服务器的HTTP端口,默认为8080 port: 18080 ``` - ```yml # 数据源配置 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver druid: # 主库数据源 master: url: jdbc:mysql://192.168.40.9:3307/hola-task?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: task password: 123456789asd ``` - ```yml # redis 配置 redis: # 地址 host: 192.168.40.9 # 端口,默认为6379 port: 6379 # 数据库索引 database: 1 ``` #### 4.2客户端配置 ​ 主要配置文件:task-client/src/main/resources/application.yml ​ 环境配置文件: - task-client/src/main/resources/application-local.yml: 开发环境 - task-client/src/main/resources/application-prod.yml: 生产环境 ​ 生产环境application-prod.yml配置 ​ 可更改: ```yml server: # 服务器的HTTP端口,默认为8080 port: 18081 ``` ```yml # 数据源配置 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver druid: # 主库数据源 master: url: jdbc:mysql://192.168.40.9:3307/hola-task?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: task password: 123456789asd ``` ​ ```yml # redis 配置 redis: # 地址 host: 192.168.40.9 # 端口,默认为6379 port: 6379 # 数据库索引 database: 1 ``` ## 5.启动: #### 5.1管理端启动: 复制项目目录下额start文件夹下的startup.sh到服务器jar包文件同级目录下 --spring.profiles.active=dev中的修改为生产环境配置文件后缀名 ```sh #启动方法 start(){ is_exist if [ $? -eq "0" ]; then echo "${APP_NAME} is already running. pid=${pid} ." else nohup java -jar $DEPLOY_DIR/$APP_NAME --spring.profiles.active=dev > $DEPLOY_DIR/nohup.out 2>&1 & echo "${APP_NAME} start success" tail -f "$LOG_URL" fi } ``` ```sh DEPLOY_DIR=/usr/local/hola-task LOG_URL=/usr/local/hola-task/nohup.out ``` #### 5.2客户端启动 ​ 复制项目目录下额start文件夹下的startup-client.sh到服务器jar包文件同级目录下,--spring.profiles.active=dev中的修改为生产环境配置文件后缀名 ```shell ```sh #启动方法 start(){ is_exist if [ $? -eq "0" ]; then echo "${APP_NAME} is already running. pid=${pid} ." else nohup java -jar $DEPLOY_DIR/$APP_NAME --spring.profiles.active=dev > $DEPLOY_DIR/nohup.out 2>&1 & echo "${APP_NAME} start success" tail -f "$LOG_URL" fi } ``` ```sh DEPLOY_DIR=/usr/local/hola-task LOG_URL=/usr/local/hola-task/nohup.out ``` #### 5.3 startup.sh - 帮助 ./startup.sh - 启动 ./startup.sh start - 停止 ./startup.sh stop - 查看状态 ./startup.sh status - 重启 ./startup.sh restart 注意 shell : - APP_NAME - spring.profiles.active - java 环境变量/路径 ```shell #进入程序目录后,执行 sh ./startup.sh start #查看进程 ps -ef | grep java #查看端口 netstat -ano | grep ``` ## 6.数据库 ​ 复制项目目录下sql/task_sql/文件下的hola-task.sql文件,导入到数据库中