From 6dbf85631ea4b3523c9331b9b502e6c2bbbe1e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Wed, 4 Dec 2024 14:41:52 +0800 Subject: [PATCH 1/3] 'commit' --- 操作文档/7、DataEase.md | 490 +++++++++++++++++++---------------- 1 file changed, 273 insertions(+), 217 deletions(-) diff --git a/操作文档/7、DataEase.md b/操作文档/7、DataEase.md index 1360c54e..ff8b2834 100644 --- a/操作文档/7、DataEase.md +++ b/操作文档/7、DataEase.md @@ -1,226 +1,219 @@ -### 一、$DataEase$最新版本下载 +### 零、系统配置 -```apl -https://community.fit2cloud.com/#/products/dataease/downloads -``` +- 操作系统 + $Rocky$ $Linux$ $9.4$ - -**在线安装** +- 修改$IP$地址 ```shell -curl -sSL https://dataease.oss-cn-hangzhou.aliyuncs.com/quick_start_v2.sh | sh +vi /etc/NetworkManager/system-connections/ens192.nmconnection +``` + +- **重启网络** + + ```shell + systemctl restart NetworkManager.service + ``` + +- **常用软件安装** + + ```shell + yum update -y + yum install wget net-tools tar + ``` + +- **系统优化** + + ```xml + vi /etc/systemd/system.conf + + # 全局的打开文件数 + DefaultLimitNOFILE=2097152 + # 全局打开进程数 + DefaultLimitNPROC=65535 + + vi /etc/sysctl.conf + + # 全局:端口最大的监听队列的长度,可为:32768 + net.core.somaxconn=32768 + # 内存分配模式:1为不限制 + vm.overcommit_memory = 1 + # 单进程打开文件句柄数 + fs.nr_open = 2097152 + # 系统打开文件句柄数 + fs.file-max = 2097152 + + # 大i/o独立部署中间件选配,例如:redis、队列、数据库等; + # 请求连接保存在队列中的最大数目 + net.ipv4.tcp_max_syn_backlog=16384 + # 网络接口接收数据包比内核处理速率快时,允许送到队列的数据包的最大数目。 + net.core.netdev_max_backlog=16384 + # 每个tcp连接占用内存,共三个值:最小字节数 默认值 最大字节数 + net.ipv4.tcp_mem = 786432 2097152 3145728 + # 每个tcp连接的读缓冲(接收缓冲),缓存从对端接收的数据,后续会被应用程序读取 + net.ipv4.tcp_rmem = 2048 32768 4194304 + # 每个tcp连接的写缓冲(发送缓冲),缓存应用程序的数据,有序列号被应答确认的数据会从发送缓冲区删除掉 + net.ipv4.tcp_wmem = 2048 8192 2097152 + ``` + + **添加完成后,刷新内核参数,立即生效:执行命令** + + ```shell + /sbin/sysctl -p + ``` + + **调整用户组的资源限制** + + ```xml + vi /etc/security/limits.conf + + # 用户会话的 打开文件句柄数 + * soft nofile 1048576 + * hard nofile 1048576 + # 用户会话的 打开进程数限制 + * soft nproc 65535 + * hard nproc 65535 + ``` + +- **需重启生效,检查是否生效** + + ``` + #用户级别的系统配置 + ulimit -a + + #open file文件限制数 + ulimit -n + + #进程限制数 + ulimit -u + ``` + +- **关闭$SeLinux$** + + - 似乎$RockyLinux$默认就是关闭的$SeLinux$ + + ``` + # 临时关闭 + setenforce 0 + + vi /etc/selinux/config + 改:7 SELINUX=enforcing #前面的 7,表示文档中第 7 行。方便你查找 + 为:7 SELINUX=disabled + ``` + +- **关闭防火墙** + + ``` + #关闭 + systemctl stop firewalld + #设置开机不启动 + systemctl disable firewalld + ``` + +- **重新启动** + + ``` + reboot + ``` + + + +### 一、$DataEase$安装 + +**安装$Docker$** + +``` +yum install -y yum-utils +yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo +sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo + +yum makecache + +# 安装最新版本Docker +yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y + +# 下载Docker Compose的最新版本 +curl -L "https://github.com/docker/compose/releases/download/v2.31.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose + +# 赋予执行权限 +chmod +x /usr/local/bin/docker-compose + +# 验证安装 +docker-compose --version ``` -**在线升级** +**在线安装** ```shell -dectl upgrade +curl -sSL https://dataease.oss-cn-hangzhou.aliyuncs.com/quick_start_v2.sh | sh ``` -### 二、$DataEase$发布 - -#### 1、$80$端口发布 +**访问办法** -##### 拉取 - -```shell -docker pull swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/openresty/openresty:1.25.3.1-5-alpine-fat ``` - -##### 打标 - -```shell -docker tag swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/openresty/openresty:1.25.3.1-5-alpine-fat docker.io/openresty/openresty:1.25.3.1-5-alpine-fat -``` - - - -##### 编辑 $nginx.conf$ - -```shell -vi /root/nginx.conf +- 访问地址 : http://10.10.14.205:8100 +- 登录用户名: admin +- 登录密码: DataEase@123456 ``` -```apl -worker_processes 1; - -events { - worker_connections 1024; -} - -http { - include mime.types; - default_type application/octet-stream; - - sendfile on; - keepalive_timeout 65; - - # DataEase 所在机器的IP - upstream dataease { - server 10.10.14.203:8100; - } - # 配置日志位置 - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - server { - # 监听端口 - listen 80; - # 监听域名(修改为你自己的域名,且域名与nginx所在服务器的IP绑定) - #server_name dataease.test.com; - - location / { - client_max_body_size 600m; - client_body_buffer_size 128k; - proxy_connect_timeout 600; - proxy_read_timeout 600; - proxy_send_timeout 600; - proxy_buffer_size 64k; - proxy_buffers 4 32k; - proxy_busy_buffers_size 64k; - proxy_temp_file_write_size 64k; - - proxy_pass http://dataease; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - } -} -``` - -##### 运行 +**在线升级** ```shell -mkdir /root/nginx_logs -docker run --name openresty -d -v /root/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf -v /root/nginx_logs:/var/log/nginx -p 80:80 openresty/openresty:1.25.3.1-5-alpine-fat +dectl upgrade ``` -#### 2、用$/dataease/$发布 -> 参考:[DataEase v2 设置动态访问路径,使用 Nginx 路径代理 - FIT2CLOUD 知识库](https://kb.fit2cloud.com/?p=57a47d64-4eda-4ae8-a0b0-4329e57b13ff) -**步骤1** +**开发环境版本** -```shell -vi /opt/dataease2.0/conf/application.yml ``` +dectl version -```yaml -server: - servlet: - context-path: /dataease -``` - -**步骤2** - -```shell -echo 'DE_CONTEXT_PATH=/dataease' >> /opt/dataease2.0/.env +current version is v2.10.1 ``` -### 三、访问方式 - -```xml -系统登录信息如下: -访问地址: https://www.edusoa.com/dataease -用户名: admin -初始密码: DataEase@123456 -``` - -![](https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/BlogImages/202410240933597.png) - - -![](https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/BlogImages/202410171024499.png) - - -### 四、异常记录 - -#### $Centos$ $7.9$ $root$账号,输入$reboot$不重新启动,怎么办? - -答: +**安装历史版本** ```shell -yum update -y -``` - -然后使用在线安装,注意:不要使用离线包,离线包问题多多! - -``` -curl -sSL https://dataease.oss-cn-hangzhou.aliyuncs.com/quick_start_v2.sh | sh -``` - -[DataEase v2 设置动态访问路径,使用 Nginx 路径代理 - FIT2CLOUD 知识库](https://kb.fit2cloud.com/?p=57a47d64-4eda-4ae8-a0b0-4329e57b13ff) - - - -### 五、备份与还原 - +wget https://dataease.oss-cn-hangzhou.aliyuncs.com/quick_start_v2.sh ``` -# 原版本机器上运行 -dectl upgrade - -# 两个机器都要执行 -service dataease stop - -# 在备份的机器上执行 -cd /root -tar -jcv -f dataease.tar.bz2 /opt/dataease2.0 -# 备份机器上启动服务 -service dataease start -# 下载 dataease.tar.bz2 并在还原的机器: -cd /root -rz -be 选择文件度上传 -# 删除原机的备份文件 -rm -rf /root/dataease.tar.bz2 +**历史版本号** -# 还原 -mv /opt/dataease2.0 /opt/dataease2.0.bak -mkdir /opt/dataease2.0 -p -tar -xjf dataease.tar.bz2 -C / - -# 在还原机上执行 -service dataease start ``` +latest_version=$(cat /tmp/de_latest_release) -#### 图片的位置 +# 黄海添加的历史版本号 +latest_version="v2.10.1" +echo "开始下载 DataEase ${latest_version} 版本在线安装包" ``` -/opt/dataease2.0/data/static-resource -``` - - -### 六、运维 - -##### 停止 +**开始安装** ``` -dectl stop +chmod +x *.sh +./quick_start_v2.sh ``` -##### 启动 -``` -dectl start -``` -### 七、黑科技 +### 二、对外暴露数据库端口 > $Q$、如果在线修改数据库中的表,以达到大屏数据直接修改的目的,而且最初的大屏是产品经理使用$Excel$进行模拟数据进行设计的,并不是真正的$Mysql$数据源,能不迁移到$Mysql$数据源就达到这个修改的目标吗,全部迁移到$Mysql$的数据源还有好多工作要做,太麻烦~ @@ -241,49 +234,28 @@ ports: - "0.0.0.0:3306:3306" ``` -​ 完整文件 +$DataEase$自己带的$Mysql$数据库就可以通过宿主机$IP$+$3306$来访问到了。 -```yaml -version: '3' -services: - mysql-de: - image: registry.cn-qingdao.aliyuncs.com/dataease/mysql:8.4.0 - container_name: ${DE_MYSQL_HOST} - ports: - - "0.0.0.0:3306:3306" - althcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u${DE_MYSQL_USER}", "-p${DE_MYSQL_PASSWORD}", "--protocol","tcp"] - interval: 5s - timeout: 3s - retries: 10 - env_file: - - ${DE_BASE}/dataease2.0/conf/mysql.env - lumes: - - ${DE_BASE}/dataease2.0/conf/my.cnf:/etc/mysql/conf.d/my.cnf - ${DE_BASE}/dataease2.0/bin/mysql:/docker-entrypoint-initdb.d/ - - ${DE_BASE}/dataease2.0/data/mysql:/var/lib/mysql - tworks: - - dataease-network + +**重启动** + +```shell +/usr/local/bin/dectl restart ``` -启动,这样才能按$mysql->dataease$ 顺序去启动 +数据库用户名与密码 ```shell -# 停止 -dectl stop - -# 启动 -dectl start +root +Password123@mysql ``` -这样,$DataEase$自己带的$Mysql$数据库就可以通过宿主机$IP$+$3306$来访问到了。 - -2. **通过修改其中的数据集完成修改工作** +**通过修改其中的数据集完成修改工作** **查询数据表** @@ -436,7 +408,7 @@ http://10.10.21.20:9000/dsBase/dataease/route?city_name=[city_name] -### 八、连接远程数据库 +### 三、连接远程数据库 ![](https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/BlogImages/202411011315540.png) @@ -461,36 +433,120 @@ password: Password123@mysql -### 九、一些问题的处理办法 +### 四、备份与还原 + +经反复实验,发现最好的备份还原方法是: + +- **使用$Navicat$ $Prenium$备份还原数据库** + +- **手动备份还原图片** -云南大屏的一个问题: -$Q$:因为大屏的地图无法通过传递外部参数进行切换城市或县区,我们还想只开发一个页面解决所有的市州问题,就只能自己想其它办法: +**图片的位置** + +``` +/opt/dataease2.0/data/static-resource +``` + +### 五、集成$Nginx$发布【非必须】 + +#### 1、$80$端口发布 -黄海给出的策略是:当点击省中某个市州的地图时,调用外部链接传递参数给黄海新开发的一个接口: +##### 拉取 +```shell +docker pull swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/openresty/openresty:1.25.3.1-5-alpine-fat ``` -http://10.10.21.20:9000/dsBase/dataease/route?city_name=%E6%98%86%E6%98%8E%E5%B8%82 + +##### 打标 + +```shell +docker tag swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/openresty/openresty:1.25.3.1-5-alpine-fat docker.io/openresty/openresty:1.25.3.1-5-alpine-fat ``` -其中$city\_name$就是市州名称,比如昆明市。 -然后此接口负责将昆明市对应的$city\_code$更新掉大屏在数据库中的数据,也就是修改了配置值。 -这样再次调用此大屏时,就变成了昆明市的地图。然后路由再将城市名称拼接成外部参数,继续向大屏传递,大屏的其它仪表盘可以接收此参数进行过滤(只有地图无法接收,只能自己想办法) -但这样实现有一个问题: -就是当用户打开了昆明市后,又打开了楚雄州,回来刷新了一下昆明市,就会发现地图是楚雄州的了~ -打补丁的办法: +##### 编辑 $nginx.conf$ -开发基于OpenResty的拦截器,发现现在的链接是 -http://10.10.14.203:8100/#/de-link/X4l1qGNH +```shell +vi /root/nginx.conf +``` -就读取后面的attachParams参数,decodeBase64,还原成{"city_name":"昆明市"} -然后调用黄海提供的写地图城市接口,先写入后再访问此页面,就可以解决刷新的问题了 -http://10.10.14.203:8100/#/de-link/X4l1qGNH?attachParams=eyJjaXR5X25hbWUiOiLmmIbmmI7luIIifQ== +```apl +worker_processes 1; +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + keepalive_timeout 65; -access.lua + # DataEase 所在机器的IP + upstream dataease { + server 10.10.14.203:8100; + } + # 配置日志位置 + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + server { + # 监听端口 + listen 80; + # 监听域名(修改为你自己的域名,且域名与nginx所在服务器的IP绑定) + #server_name dataease.test.com; + + location / { + client_max_body_size 600m; + client_body_buffer_size 128k; + proxy_connect_timeout 600; + proxy_read_timeout 600; + proxy_send_timeout 600; + proxy_buffer_size 64k; + proxy_buffers 4 32k; + proxy_busy_buffers_size 64k; + proxy_temp_file_write_size 64k; + + proxy_pass http://dataease; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } +} +``` + +##### 运行 + +```shell +mkdir /root/nginx_logs +docker run --name openresty -d -v /root/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf -v /root/nginx_logs:/var/log/nginx -p 80:80 openresty/openresty:1.25.3.1-5-alpine-fat +``` + +#### 2、用$/dataease/$发布 + +> 参考:[DataEase v2 设置动态访问路径,使用 Nginx 路径代理 - FIT2CLOUD 知识库](https://kb.fit2cloud.com/?p=57a47d64-4eda-4ae8-a0b0-4329e57b13ff) + +**步骤1** + +```shell +vi /opt/dataease2.0/conf/application.yml +``` + +```yaml +server: + servlet: + context-path: /dataease +``` + +**步骤2** + +```shell +echo 'DE_CONTEXT_PATH=/dataease' >> /opt/dataease2.0/.env +``` -TODO From 7e230d7de1ef90e783e559ae79ce38e17afa4744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Wed, 4 Dec 2024 14:43:51 +0800 Subject: [PATCH 2/3] 'commit' --- 操作文档/7、DataEase.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/操作文档/7、DataEase.md b/操作文档/7、DataEase.md index ff8b2834..d518d5ad 100644 --- a/操作文档/7、DataEase.md +++ b/操作文档/7、DataEase.md @@ -121,7 +121,7 @@ vi /etc/NetworkManager/system-connections/ens192.nmconnection ### 一、$DataEase$安装 -**安装$Docker$** +**安装$Docker$**,$Docker$ $Compose$ ``` yum install -y yum-utils @@ -134,7 +134,7 @@ yum makecache yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y # 下载Docker Compose的最新版本 -curl -L "https://github.com/docker/compose/releases/download/v2.31.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose +curl -L "https://mirror.ghproxy.com/https://github.com/docker/compose/releases/download/v2.31.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose # 赋予执行权限 chmod +x /usr/local/bin/docker-compose From 05b97700d2365701304c2ed3918e53ef330a4c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Thu, 5 Dec 2024 08:20:43 +0800 Subject: [PATCH 3/3] 'commit' --- 操作文档/7、DataEase.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/操作文档/7、DataEase.md b/操作文档/7、DataEase.md index d518d5ad..59075438 100644 --- a/操作文档/7、DataEase.md +++ b/操作文档/7、DataEase.md @@ -91,8 +91,6 @@ vi /etc/NetworkManager/system-connections/ens192.nmconnection - **关闭$SeLinux$** - - 似乎$RockyLinux$默认就是关闭的$SeLinux$ - ``` # 临时关闭 setenforce 0 @@ -101,7 +99,7 @@ vi /etc/NetworkManager/system-connections/ens192.nmconnection 改:7 SELINUX=enforcing #前面的 7,表示文档中第 7 行。方便你查找 为:7 SELINUX=disabled ``` - + - **关闭防火墙** ```