推荐使用2核4G、40G系统盘的云服务器,操作系统选择CentOS7.9 64位,提前在安全组开放80(Web访问)、3306(MySQL)、9200(ElasticSearch)、9000(MinIO)端口,来源设置为你的办公IP段,避免公网暴露高危端口。
执行以下命令安装JDK1.8:
``` yum install -y java-1.8.0-openjdk-devel java -version ```返回openjdk version "1.8.0_xxx"即为安装成功。
执行以下命令安装MySQL8.0:
``` rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm yum install -y mysql-community-server systemctl start mysqld systemctl enable mysqld 获取初始密码 grep 'temporary password' /var/log/mysqld.log 登录修改密码,将下方的新密码替换为自己的复杂密码 mysql -uroot -p初始密码 ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码'; 创建系统库 CREATE DATABASE pre_sale_archive DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; exit ```执行以下命令安装ElasticSearch7.10:
``` rpm -ivh https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.2-x86_64.rpm 修改配置文件 echo 'network.host: 0.0.0.0' >> /etc/elasticsearch/elasticsearch.yml echo 'discovery.type: single-node' >> /etc/elasticsearch/elasticsearch.yml systemctl start elasticsearch systemctl enable elasticsearch 验证,返回json数据即为成功 curl http://localhost:9200 ```执行以下命令安装MinIO对象存储:
``` wget https://dl.min.io/server/minio/release/linux-amd64/minio -P /usr/local/bin/ chmod +x /usr/local/bin/minio mkdir -p /data/minio 启动命令,将MINIO_ROOT_PASSWORD修改为你的自定义密码 nohup minio server /data/minio --console-address ":9001" & echo 'export MINIO_ROOT_USER=admin' >> /etc/profile echo 'export MINIO_ROOT_PASSWORD=你的MinIO密码' >> /etc/profile source /etc/profile ```执行以下命令下载编译好的可执行jar包:
``` wget https://github.com/opensource-pre-sale/pre-sale-archive/releases/download/v1.0.0/pre-sale-archive.jar -P /opt/pre-sale/ ```
在/opt/pre-sale目录下新建application.yml文件,内容如下,所有标“替换为你自己的”的字段修改为你的实际配置:
```yaml server: port: 80 spring: datasource: url: jdbc:mysql://localhost:3306/pre_sale_archive?useUnicode=true&characterEncoding=utf8mb4&serverTimezone=Asia/Shanghai username: root password: 替换为你的MySQL密码 driver-class-name: com.mysql.cj.jdbc.Driver elasticsearch: uris: http://localhost:9200 servlet: multipart: max-file-size: 100MB max-request-size: 100MB minio: endpoint: http://替换为你的服务器IP:9000 accessKey: admin secretKey: 替换为你的MinIO密码 bucketName: pre-sale-archive ocr: lang: chi_sim ```执行以下命令启动系统:
``` cd /opt/pre-sale nohup java -jar pre-sale-archive.jar --spring.config.location=./application.yml & ```等待30秒后执行curl http://localhost/health,返回{"code":200,"msg":"success"}即为启动成功,浏览器访问你的服务器IP,默认账号为admin,默认密码为123456,即可进入系统后台。
按照以下步骤配置预售许可证的录入字段:
先安装OCR中文语言包,执行命令:
``` yum install -y tesseract tesseract-langpack-chi_sim ```再按照以下步骤配置归档流程:
按照以下步骤配置检索能力:
yum install -y certbot && certbot certonly --webroot -w /var/www/html -d 你的域名,然后在配置文件中添加SSL配置即可0 1 mysqldump -u root -p你的MySQL密码 pre_sale_archive > /backup/$(date +%Y%m%d).sqlclient_max_body_size 100M;curl http://localhost:9200/_cat/indices 检查pre_sale_archive索引是否存在,若不存在则在后台手动触发重建索引即可