安装与启动常见问题
Nginx 相关配置
上传文件是否有大小限制?
产品对上传文件要求不大于50MB, 如配置反向代理,需要配置上传文件大小,以 Nginx 为例,在配置文件中进行下配置。
# nginx 配置文件/etc/nginx/nginx.conf, 在对应 server 中配置
client_max_body_size 100m;
如何设置超时时间?
在配置文件中进行 timeout 的设置。
# nginx 配置文件/etc/nginx/nginx.conf, 在对应 server 中配置
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
如何通过80和443端口进行服务?
HENGSHI SENSE 不能以 root 启动,所以不能绑定小于1024的端口。如需监听80和443端口,建议使用 nginx 做反向代理。 建立配置文件/etc/nginx/conf.d/hengshi.conf,内容如下。
# hengshi proxy
upstream hengshi-proxy {
server $IP:$PORT;
}
server {
server_name $SERVNAME;
access_log /var/log/nginx/access.log main;
listen 80;
location / {
proxy_pass http://hengshi_proxy;
}
}
server {
server_name $SERVNAME
listen 443 ssl http2; # 一定要配置 https 2.0 提升浏览器请求并发数
access_log /var/log/nginx/access.log main;
gzip on; #开启 gzip 压缩,优化页面加载速度
gzip_vary on;
client_max_body_size 200M;
proxy_connect_timeout 900;
proxy_read_timeout 900;
proxy_send_timeout 900;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS';
ssl_prefer_server_ciphers on;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_certificate $PATH_TO_CER
ssl_certificate_key $PATH_TO_CER_KEY
add_header Strict-Transport-Security "max-age=31536000" always;
location / {
# 以下 X-Forwarded-Host 与 X-Forwarded-Proto 设置,对于 SSO 场景是必要的,注意不要遗漏!
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://hengshi-proxy;
}
}
其中,变量需要替换成真实值。
- IP: 部署 HENGSHI 的机器 ip。
- PORT: HENGSHI 服务绑定的端口。
- SERVNAME: Nginx 用于提供服务的 hostname。
- PATH_TO_CER, PATH_TO_CER_KEY: 分别是提供 ssl 服务的 cer/key 文件的绝对路径。
安装相关问题
安装后服务器 hostname 是否可以修改?
安装后服务器 hostname 不可更改, 如需更改请联系技术支持做迁移操作。
磁盘空间不足
[2023-05-06.11:19:13.150][hs_install:68][ ERROR ]: /opt/hengshi capacity is less than 10G, abort installation! Please check the disk or use larger disk
此问题产生原因为磁盘空间不足,清理磁盘空间或增加磁盘空间后,继续进程安装升级操作。
使用用外部 metadb 或外部 engine
IS ACTIVE! : [metadb] @127.0.0.1:54320/hengshi
NOT ACTIVE! : [engine] @127.0.0.1:15432/hengshi
NOT ACTIVE! : [minio] minio server /opt/hengshi/minio-data
NOT ACTIVE! : [redis] redis-server .*:6379
NOT ACTIVE! : [flink] /opt/hengshi/lib/flink
NOT ACTIVE! : [syslog] syslog-ng --no-caps --module-path=/opt/hengshi/lib/syslog-ng/lib/syslog-ng -f /opt/hengshi/conf/syslog-ng.conf -p /opt/hengshi/logs/syslog-ng.pid -R /opt/hengshi/logs/syslog-ng.persist -c /opt/hengshi/logs/syslog-ng.ctl
NOT ACTIVE! : [hengshi] jar /opt/hengshi/lib/bootstrap-4.4-SNAPSHOT.jar
NOT ACTIVE! : [monit] /opt/hengshi/lib/monit/bin/monit -c /opt/hengshi/lib/monit/conf/monitrc
[2023-05-06.11:21:14.303][hs_install:128][ ERROR ]: /opt/hengshi has instance running! STOP ALL instance first!
使用外部 metadb 或引擎,无法通过 hengshi 脚本控制外部服务状态,可通过参数控制,安装升级跳过外部组价状态检查
./hs_install -p /opt/hengshi/ -e [all|metadb|engine] ## 同时使用外部 metadb、engine,参数选择 all
init-os 初始化失败,用户缺失 sudo 权限
[2023-05-06.11:31:19.337][hengshi@cluster1][hengshi-sense-bin:599][ INFO ]: internal pg metastore 10.10.10.xxx:54320
sudo: a password is required
INIT FAIL! : [dependent packages]
为部署用户增加 sudo 权限
#使用具有 sudo 权限用户或 root 用户
echo "hengshi ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
init engine 失败,重新初始化操作
INIT FAIL! : [engine] /opt/hengshi/engine-cluster
初始化引擎失败后,排查失败原因后,重新初始化操作
cd /opt/hengshi
bin/hengshi-sense-bin stop engine
rm engine-cluster -rf
bin/hengshi-sense-bin init engine
Ubuntu 18.04 init eninge 失败
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 not found
Ubuntu 18.04默认环境中可能未安装 python2.7的相关依赖库,安装相关依赖库后重新执行初始化操作
sudo apt install -y libpython2.7
启动相关问题
内核参数问题,导致启动引擎失败
[2023-05-06.03:39:33.960][hengshi@0c3eb9a1f944][hengshi-sense-bin:45][ INFO ]: starting engine
[2023-05-06.03:39:33.972][hengshi@0c3eb9a1f944][hengshi-sense-bin:811][ INFO ]: check resources needed if avaiable.
127.0.0.1 checkHostSysConfig fail! kernel.sem is not set properly, please check it manually in /etc/sysctl.conf and /etc/sysctl.d/*.conf
current sem: 250 32000 32 128, at least should be: '250 2018500 100 8074'
false
此错误信息出现问题肯能性存为
- 未正确执行 init-os all 操作shell
cd /opt/hengshi bin/hengshi-sense-bin init-os all
- 正确执行 init-os all 操作shell
sudo su - hengshi ## 重新登录用户后,重新在家内核参数 cd /opt/hengshi bin/hengshi-sense-bin start engine
端口冲突,导致服务启动失败
[2023-05-06.03:51:22.860][hengshi@0c3eb9a1f944][hengshi-sense-bin:773][ ERROR ]: metadb port 54320 is not avaiable.
Resrouces needed are not available, Abort!
上述实例表示为54320端口已经被使用,检查提示服务是否已经启动,如服务未启动,请修改配置文件中服务默认使用端口重新启动服务
jdk 版本问题,导致 hengshi 服务启动失败
[2023-05-06.03:45:36.835][hengshi@0c3eb9a1f944][hengshi-sense-bin:1226][ ERROR ]: required: java >= 11.0.0
hengshi 服务依赖 jdk11版本,解决方式如下
- 执行 init-os all,程序会自动从互联网获取 jdk-11资源shell
cd /opt/hengshi bin/hengshi-sense-bin init-os all
- 当部署环境为内网环境且无法连通互联网,可参考离线环境依赖组件准备
doris 引擎启动失败
[2023-05-06.03:51:22.860][hengshi@0c3eb9a1f944][hengshi-sense-bin:773][ ERROR ]: please set DORIS_FE_HOSTS and DORIS_BE_HOSTS params
此问题参考Doris 引擎配置
[2023-05-06.03:45:36.835][hengshi@0c3eb9a1f944][hengshi-sense-bin:1226][ ERROR ]:Doris engine is required by JDK-1.8
doris 引擎服务依赖 jdk-1。8版本,解决方式如下
- 执行 init-os all,程序会自动从互联网获取 jdk-1.8资源shell
cd /opt/hengshi bin/hengshi-sense-bin init-os all
- 当部署环境为内网环境且无法连通互联网,可参考离线环境依赖组件准备
metadb 版本过低导致 hengshi 服务启动失败
[2023-05-11 18:50:15.162] [783213] [] [] [0] [] [1] [ERROR] [org.springframework.boot.SpringApplication] [821] - Application run failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException: Flyway Teams Edition or PostgreSQL upgrade required: PostgreSQL 9.6 is no longer supported by Flyway Community Edition, but still supported by Flyway Teams Edition.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
at com.hengshi.nangaparbat.bootstrap.Bootstrap.main(Bootstrap.java:131)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
Caused by: org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException: Flyway Teams Edition or PostgreSQL upgrade required: PostgreSQL 9.6 is no longer supported by Flyway Community Edition, but still supported by Flyway Teams Edition.
at org.flywaydb.core.internal.database.base.Database.ensureDatabaseNotOlderThanOtherwiseRecommendUpgradeToFlywayEdition(Database.java:130)
at org.flywaydb.core.internal.database.postgresql.PostgreSQLDatabase.ensureSupported(PostgreSQLDatabase.java:61)
at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:190)
at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 26 common frames omitted
此问题产生原因为,衡石服务不支持使用<10版本 postgresql 作为 metadb 服务 请参考数据库服务升级
syslog 服务启动失败
/opt/hengshi/lib/syslog-ng/sbin/syslog-ng: relocation error: /opt/hengshi/lib/syslog-ng/lib/libresolv.so.2: symbol __h_errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
- 部署环境 glibc 版本过低。text
### centos7.4 版本举例,glibc 升级到2.17-326.el7_9版本 Installed Packages glibc.x86_64 2.17-196.el7 @CentOS Available Packages glibc.i686 2.17-326.el7_9 updates glibc.x86_64 2.17-326.el7_9 updates
- 升级 glibc 后,重启 syslog 服务shell
cd /opt/hengshi bin/hengshi-sense-bin start syslog
Oauth2 配置相关问题
ubuntu 18.04 证书问题导致 OAuth2 配置失败问题
环境 jdk 版本为1.8 存在此问题
HttpCommunicationException:javax.net.ss1.SSLException: java.1ang.RuntimeException: Unexpected error: java.security. InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun. security.ssl.Alerts.getSSLException(Alerts.java:214)
at sun.security.ss1.SSLSocketImp1.fatal(SSLSocketImp1.java:1958)
at sun.security.ssl.SSLSocketImpl.fatal (SSLSocketImpl.java:1915)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImp1.java:1898)
at sun.security.ss1. SSLSocketImpl.startHandshake(SSLSocketImpl.java:1419)
at sun.security.ss1.SSLSocketImpl.startHandshake(SSLSocketImp1.java:1396)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDel egateHttpsURLConnection. java:185) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImp1.java:250)
at com. gi thub.scribejava.core.httpclient.jdk.JDKHttpClient.prepareConnectionForBodyAndGetOutputStream(JDKHttpClient.java:224) at com. github.scribejava.core.httpclient. jdk.JDKHttpClient.addBody(JDKHttpClient. java:211)
at cmaithuh errihoiava coro httneliont idl TKH+tnliant aoce$100(TKH++n1iont iava·24)
执行下述命令,重新安装 OAuth2 配置是否成功
sudo apt-get install ca-certificates-java -y
sudo update-ca-certificates -f
截图工具依赖相关问题
所有截图工具执行都失败,包括pdf导出和png导出
关键词是libplc4.so,libnss3,类似日志如下:
[2024-11-11T10:06:15.235+0800] [710760] [10.74.194.115] [10.74.194.115] [8081] [01JCCFHFE13MN9RWFT65F368AB] [11909] [DEBUG] [com.hengshi.nangaparbat.screenshot.JavaShellExecutor] [53] - CommandLine: /bin/bash /opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/bin/hengshi-shot.sh --shotType=png --shotPath=/opt/hengshi/temp_data/screenshot/83833603-4468-49c2-b80e-19e29b572a0b.png --shotUrl=http://localhost:8081/screenshot/app/E2310E8E94FC0BEA3C0E98092210BB83A/dashboard/E8787F9BA9F818810116C95BBA55D0411?activeClickQuerys=&activeTabs=&cacheId=01JCCFHFE13MN9RWFT65F368AB&haveBackground=1&haveTitle=true&height=960&locale=zh-CN&mode=pc&requestId=01JCCFHFE13MN9RWFT65F368AB&timeout=55000&totalHeight=960&type=png&width=2048 --skey=ca03fea5-5bfa-4c58-aa81-9da1e444677c-238b40fc-e5ba-4527-b938-2bfbe21fbba5 --uid=2 --tenantId=null --timeout=52000 exec time: 167 ms
[2024-11-11T10:06:15.235+0800] [710760] [10.74.194.115] [10.74.194.115] [8081] [01JCCFHFE13MN9RWFT65F368AB] [11909] [INFO] [com.hengshi.nangaparbat.screenshot.CommandHelper] [106] - CommandLine stdout: {"_":[],"shotType":"png","shotPath":"/opt/hengshi/temp_data/screenshot/83833603-4468-49c2-b80e-19e29b572a0b.png","shotUrl":"http://localhost:8081/screenshot/app/E2310E8E94FC0BEA3C0E98092210BB83A/dashboard/E8787F9BA9F818810116C95BBA55D0411?activeClickQuerys=&activeTabs=&cacheId=01JCCFHFE13MN9RWFT65F368AB&haveBackground=1&haveTitle=true&height=960&locale=zh-CN&mode=pc&requestId=01JCCFHFE13MN9RWFT65F368AB&timeout=55000&totalHeight=960&type=png&width=2048","skey":"ca03fea5-5bfa-4c58-aa81-9da1e444677c-238b40fc-e5ba-4527-b938-2bfbe21fbba5","uid":2,"tenantId":"null","timeout":52000}
Failed to launch the browser process!
/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/.local-chromium/linux-884014/chrome-linux/chrome: error while loading shared libraries: libplc4.so: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
Error: Failed to launch the browser process!
/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/.local-chromium/linux-884014/chrome-linux/chrome: error while loading shared libraries: libplc4.so: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:194:20)
at Interface.helper_js_1.helper.addEventListener (/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:68)
安装NSS库: 在大多数Linux发行版上,可以通过包管理器安装所需的NSS库。根据你的发行版,使用以下命令之一,其他系统的安装请参考操作系统的依赖安装文档:
Ubuntu/Debian:
bashsudo apt-get update sudo apt-get install libnss3
CentOS/RHEL:
bashsudo yum install nss
Fedora:
bashsudo dnf install nss
检查库文件: 安装完依赖库后,检查一下
libplc4.so
是否在系统的库路径中。可以使用find
命令查找此文件:bashfind / -name libplc4.so
在进行上述操作后,尝试再次运行执行pdf和png导出操作,应该可以成功导出。如果问题依旧存在,请确保系统架构和相关软件版本的兼容性。