Skip to content

安装与启动常见问题

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 不可更改, 如需更改请联系技术支持做迁移操作。

磁盘空间不足

text
[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

text
 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 脚本控制外部服务状态,可通过参数控制,安装升级跳过外部组价状态检查

shell
./hs_install -p /opt/hengshi/ -e [all|metadb|engine] ## 同时使用外部 metadb、engine,参数选择 all

init-os 初始化失败,用户缺失 sudo 权限

text
[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 权限

shell
#使用具有 sudo 权限用户或 root 用户
echo "hengshi ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers

init engine 失败,重新初始化操作

text
 INIT FAIL! : [engine] /opt/hengshi/engine-cluster

初始化引擎失败后,排查失败原因后,重新初始化操作

shell
cd /opt/hengshi
bin/hengshi-sense-bin stop engine
rm engine-cluster -rf
bin/hengshi-sense-bin init engine

Ubuntu 18.04 init eninge 失败

text
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 not found

Ubuntu 18.04默认环境中可能未安装 python2.7的相关依赖库,安装相关依赖库后重新执行初始化操作

text
sudo apt install -y libpython2.7

启动相关问题

内核参数问题,导致启动引擎失败

text
[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

端口冲突,导致服务启动失败

text
[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 服务启动失败

text
[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 引擎启动失败

text
[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 引擎配置

text
[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 服务启动失败

text
[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 服务启动失败

text
/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 存在此问题

text
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 配置是否成功

shell
sudo apt-get install ca-certificates-java -y
sudo update-ca-certificates -f

衡石分析平台使用手册