Installation and Startup FAQ
Nginx Configuration
Is there a size limit for uploading files?
The product requires uploaded files to be no larger than 50MB. If a reverse proxy is configured, the upload file size needs to be configured. Taking Nginx as an example, configure it in the configuration file as follows.
# nginx configuration file /etc/nginx/nginx.conf, configure in the corresponding server
client_max_body_size 100m;
How to Set Timeout?
Set the timeout in the configuration file.
# nginx configuration file /etc/nginx/nginx.conf, configure in the corresponding server
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
How to Serve via Ports 80 and 443?
HENGSHI SENSE cannot be started as root, so it cannot bind to ports below 1024. If you need to listen on ports 80 and 443, it is recommended to use nginx as a reverse proxy. Create the configuration file /etc/nginx/conf.d/hengshi.conf
with the following content.
# 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; # It is necessary to configure https 2.0 to increase the number of concurrent browser requests
access_log /var/log/nginx/access.log main;
gzip on; # Enable gzip compression to optimize page loading speed
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 / {
# The following X-Forwarded-Host and X-Forwarded-Proto settings are necessary for SSO scenarios, be sure not to omit them!
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://hengshi-proxy;
}
}
The variables need to be replaced with actual values.
- IP: The machine IP where HENGSHI is deployed.
- PORT: The port that the HENGSHI service is bound to.
- SERVNAME: The hostname used by Nginx to provide the service.
- PATH_TO_CER, PATH_TO_CER_KEY: The absolute paths to the cer/key files for the SSL service, respectively.
Installation Related Issues
Can the server hostname be modified after installation?
The server hostname cannot be changed after installation. If you need to change it, please contact technical support for migration operations.
Insufficient Disk Space
[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
This issue occurs due to insufficient disk space. After cleaning up the disk space or increasing the disk space, proceed with the installation or upgrade process.
Use External metadb or External 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!
Using an external metadb or engine, the status of external services cannot be controlled through the hengshi script. It can be controlled through parameters, and the installation and upgrade can skip the status check of external components.
./hs_install -p /opt/hengshi/ -e [all|metadb|engine] ## Use both external metadb and engine, choose the parameter all
init-os initialization failed, user lacks sudo privileges
[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]
Add sudo privileges for the deployment user
#Use a user with sudo privileges or root user
echo "hengshi ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
init engine failed, reinitialize operation
INIT FAIL! : [engine] /opt/hengshi/engine-cluster
After the engine initialization fails, troubleshoot the failure reason, and then reinitialize the operation
cd /opt/hengshi
bin/hengshi-sense-bin stop engine
rm engine-cluster -rf
bin/hengshi-sense-bin init engine
Ubuntu 18.04 init engine failure
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 not found
The default environment of Ubuntu 18.04 may not have the necessary dependencies for python2.7 installed. After installing the relevant dependencies, re-execute the initialization operation.
sudo apt install -y libpython2.7
Startup-related Issues
Kernel Parameter Issue Leading to Engine Startup Failure
[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
This error message may occur due to the following reasons:
- The
init-os all
operation was not executed correctlyshellcd /opt/hengshi bin/hengshi-sense-bin init-os all
- The
init-os all
operation was executed correctlyshellsudo su - hengshi ## Re-login the user and re-initialize kernel parameters cd /opt/hengshi bin/hengshi-sense-bin start engine
Port Conflict Leading to Service Startup Failure
[2023-05-06.03:51:22.860][hengshi@0c3eb9a1f944][hengshi-sense-bin:773][ ERROR ]: metadb port 54320 is not available.
Resources needed are not available, Abort!
The above example indicates that port 54320 is already in use. Check if the service is already running. If the service is not running, modify the default port used by the service in the configuration file and restart the service.
JDK Version Issue Causes HENGSHI Service Startup Failure
[2023-05-06.03:45:36.835][hengshi@0c3eb9a1f944][hengshi-sense-bin:1226][ ERROR ]: required: java >= 11.0.0
The HENGSHI service depends on JDK 11. The solutions are as follows:
- Execute
init-os all
, the program will automatically fetch the JDK-11 resources from the internet.shellcd /opt/hengshi bin/hengshi-sense-bin init-os all
- When the deployment environment is an offline network and cannot connect to the internet, refer to Offline Environment Dependency Preparation.
Doris Engine Startup Failure
[2023-05-06.03:51:22.860][hengshi@0c3eb9a1f944][hengshi-sense-bin:773][ ERROR ]: please set DORIS_FE_HOSTS and DORIS_BE_HOSTS params
Refer to Doris Engine Configuration for this issue.
[2023-05-06.03:45:36.835][hengshi@0c3eb9a1f944][hengshi-sense-bin:1226][ ERROR ]:Doris engine is required by JDK-1.8
The Doris engine service depends on JDK-1.8. The solutions are as follows:
- Execute
init-os all
, the program will automatically fetch JDK-1.8 resources from the internet.shellcd /opt/hengshi bin/hengshi-sense-bin init-os all
- If the deployment environment is an offline network and cannot connect to the internet, refer to Offline Environment Dependency Preparation.
Low metadb Version Causes HENGSHI Service Startup Failure
[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
The cause of this issue is that the HENGSHI service does not support using PostgreSQL <10 as the metadb service. Please refer to Database Service Upgrade.
syslog service startup failure
/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
- The deployment environment has a low glibc version.text
### Example with CentOS 7.4, upgrade glibc to version 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
- After upgrading glibc, restart the syslog serviceshell
cd /opt/hengshi bin/hengshi-sense-bin start syslog
Oauth2 Configuration Issues
Certificate Issue on Ubuntu 18.04 Leading to OAuth2 Configuration Failure
Environment: JDK version 1.8 is affected by this issue.
HttpCommunicationException: javax.net.ssl.SSLException: java.lang.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.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1958)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1915)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1898)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1419)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1396)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.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(HttpsURLConnectionImpl.java:250)
at com.github.scribejava.core.httpclient.jdk.JDKHttpClient.prepareConnectionForBodyAndGetOutputStream(JDKHttpClient.java:224)
at com.github.scribejava.core.httpclient.jdk.JDKHttpClient.addBody(JDKHttpClient.java:211)
at com.github.scribejava.core.httpclient.jdk.JDKHttpClient.execute(JDKHttpClient.java:100)
Execute the following commands to reinstall and check if the OAuth2 configuration is successful.
sudo apt-get install ca-certificates-java -y
sudo update-ca-certificates -f
Screenshot Tool Dependency Issues
All Screenshot Tools Fail, Including PDF and PNG Export
The key terms are libplc4.so
and libnss3
. The following is a similar log:
[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)
Install the NSS Library: On most Linux distributions, you can install the required NSS library via the package manager. Use one of the following commands based on your distribution. For other systems, refer to the dependency installation documentation of the operating system:
Ubuntu/Debian:
bashsudo apt-get update sudo apt-get install libnss3
CentOS/RHEL:
bashsudo yum install nss
Fedora:
bashsudo dnf install nss
Check the Library File: After installing the dependency library, check if
libplc4.so
is in the system's library path. You can use thefind
command to locate this file:bashfind / -name libplc4.so
After performing the above operations, try running the PDF and PNG export operations again. They should be successful. If the issue persists, ensure compatibility of the system architecture and related software versions.