yum install -y git java-1.8.0-openjdk*
wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz --no-check-certificate
tar zxvf apache-maven-3.8.6-bin.tar.gz
mv apache-maven-3.8.6 /opt
echo "export M2_HOME=/opt/apache-maven-3.8.6" >> ~/.bashrc
echo "export PATH=\$PATH:\$M2_HOME/bin" >> ~/.bashrc
source ~/.bashrc
默认安装 Maven 后,在 Maven 安装目录中有配置文件 settings.xml该文件中默认开启了 mirror,可以将该 mirror 设置注释掉:
vim /opt/apache-maven-3.8.6/conf/settings.xml
wget https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz
tar xvf node-v16.13.0-linux-x64.tar.xz
mv node-v16.13.0-linux-x64 /opt
echo "export PATH=\$PATH:/opt/node-v16.13.0-linux-x64/bin" >> ~/.bashrc
source ~/.bashrc
#增加系统监听文件数量
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
忽略mysql安装
# DataEase 配置文件
mkdir -p /opt/dataease/conf
mkdir -p /opt/dataease/logs
# 添加 DataEase 运行配置文件,除了 MySQL 连接信息必须正确外,Kettle 和 Doris 如不用的话,相关信息可不修改
vim /opt/dataease/conf/dataease.properties
# 数据库配置
spring.datasource.url=jdbc:mysql://10.1.11.137:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.username=root
spring.datasource.password=Password123@mysql
carte.host=kettle
carte.port=18080
carte.user=cluster
carte.passwd=cluster
doris.db=dataease
doris.user=root
doris.password=Password123@doris
doris.host=doris-fe
doris.port=9030
doris.httpPort=8030
#新建用户初始密码
dataease.init_password=DataEase123456
#登录超时时间单位min 如果不设置 默认8小时也就是480
dataease.login_timeout=480
logger.level=INFO
#DE运行模式,可选值有 local、simple、cluster,分别对应本地模式、精简模式、集群模式 engine_mode=simple
#编译及运行
git clone -b v1.12.0 https://github.com/dataease/dataease.git
#地图驱动
mkdir -p /opt/dataease/data/feature
cd dataease
cp -rp mapFiles/full /opt/dataease/data/feature/full
mkdir -p /opt/dataease/drivers
cp -rp drivers/* /opt/dataease/drivers/
#插件库准备
mkdir -p /opt/dataease/plugins/default
建议从镜像中拷贝!!!
源码准备 - DataEase 文档
cd frontend
npm run build:stage
遇到问题
sh: vue-cli-service: command not found
解决方法 npm install
frontend 编译后文件存放目录 /opt/dataease/frontend/dist
mkdir -p /opt/dataease/frontend/dist
cp -r frontend/dist/* /opt/dataease/frontend/dist
npm config set registry https://registry.npm.taobao.org
注意:国内使用 npm 时经常会遇到网络问题,可以考虑将 npm 源替换为国内的源。可以参考文档 https://segmentfault.com/a/1190000023314583
cd backend
mvn clean package -Pstage
npm run build:stage
运行后端
cd /root/dataease/backend/target && nohup java -jar backend-1.12.0.jar &
查看运行成功
jps
本地仓库缺少包
cd /root/dataease/backend
git clone -b v1.7 https://github.com/dataease/dataease-plugins.git
cd /root/dataease/backend/dataease-plugins && mvn clean install
cd /root/dataease/backend/dataease-plugins/pom.xml
##注释掉
cd mobile
npm install
npm run build:stage
mkdir -p /opt/dataease/mobile/dist
cp -r mobile/dist/* /opt/dataease/mobile/dist
mv /opt/dataease/mobile/dist/index.html /opt/dataease/mobile/dist/app.html
遇到问题
ERROR Error: Cannot find module '@vue/babel-preset-app'
npm install @vue/babel-preset-app
五、配置 nginx
#Nginx Linux 安裝部署
#openssl pcre zlib nginx 下载
wget http://nginx.org/download/nginx-1.10.2.tar.gz
wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz
wget http://zlib.net/zlib-1.2.11.tar.gz
wget https://netix.dl.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz
#安装c++编译环境yum install gcc-c++
#openssl pcre zlib nginx 解压安装
tar zxvf openssl-fips-2.0.10.tar.gz
tar zxvf pcre-8.40.tar.gz
tar zxvf zlib-1.2.11.tar.gz
tar zxvf nginx-1.10.2.tar.gz
mkdir -p usr/local/src
cp -rp nginx-1.10.2 /usr/local/src/ && cp -rp zlib-1.2.11 /usr/local/src/ && cp -rp pcre-8.40 /usr/local/src/ && cp -rp openssl-fips-2.0.10 /usr/local/src/
cd /usr/local/src/openssl-fips-2.0.10 && ./config && make && make install
cd /usr/local/src/pcre-8.40 && ./configure && make && make install
cd /usr/local/src/zlib-1.2.11 && ./configure && make && make install
cd /usr/local/src/nginx-1.10.2 && ./configure && make && make install
whereis nginx
#启动 /usr/local/nginx/sbin/nginx
#配置nginx
vim /usr/local/nginx/conf/nginx.conf
vim /usr/local/nginx/conf/nginx.conf
server {
listen 8000;
server_name localhost;
location / {
root /opt/dataease/frontend/dist/;
index index.html;
}
location /app.html {
root /opt/dataease/mobile/dist/;
}
location /de-app/ {
alias /opt/dataease/mobile/dist/;
}
location /de-api/ {
proxy_pass http://localhost:8081/de-api/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host:8000;
server_name_in_redirect on;
}
}
Nginx 默认通过 8000 端口通信,需要打开防火墙的 8000 端口:
firewall-cmd --zone=public --add-port=8000/tcp --permanent
firewall-cmd --reload
五、配置 Https
请参考:配置 DataEase 使用 https 访问 - 知识库 - FIT2CLOUD 飞致云