在启动时在OpenShift上运行Apache Drill失败

问题描述

在openshift上运行Apache演习有经验吗?

我在尝试在openshift中运行标准docker-image时遇到问题 https://hub.docker.com/r/apache/drill 实际上只是嵌入式模式,而无需尝试进行任何配置。

如果我在本地docker桌面守护程序中运行它,它将运行良好,并且完全可以。 但是当我将它部署到openshift时,甚至没有启动它就变得很奇怪。

我的部署Yaml非常简单:

apiVersion: apps/v1
kind: Deployment
Metadata:
  name: apache-drill
  labels:
    app.kubernetes.io/component: apache-drill-svc
spec:
  replicas: 1
  selector:
    matchLabels:
  template:
    Metadata:
      labels:
        app.kubernetes.io/component: apache-drill-svc
    spec:
      containers:
        - name: apache-drill
          image: apache/drill
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 1
              memory: 1Gi
            limits:
              cpu: 4
              memory: 4Gi

但是一旦启动,这是由于日志目录而导致启动失败的反馈:

pod events

pod log

我认为这可能是因为有关安全性的此准则。 https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines

因此,因此我尝试创建自己的图像来包装官方图像: https://hub.docker.com/r/cstmgl/adrill/tags(可能有更好的方法可以做到这一点) 无论如何,我什至仍然以为该映像在本地docker守护程序中也可以最终工作,但仍然出现错误,但是如果我在OpenShift上尝试它,则会出现此错误

apiVersion: apps/v1
kind: Deployment
Metadata:
  name: apache-drill
  labels:
    app.kubernetes.io/component: apache-drill-svc
spec:
  replicas: 1
  template:
    Metadata:
      labels:
        app.kubernetes.io/component: apache-drill-svc
    spec:
      containers:
        - name: apache-drill
          image: cstmgl/adrill:1.18.0
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 1
              memory: 1Gi
            limits:
              cpu: 4
              memory: 4Gi

知道我在做什么错吗?我将用实际的启动错误尽快对此进行更新,这是相当基本的,但是我相信这是用户运行应用程序时遇到的问题,只是不确定如何解决它。

second event logs

ERROR: Drill config file not readable: /opt/drill/conf/drill-override.conf - Wrong user?

无论如何,我也在dockerfile中将该图像更改为类似的内容

FROM cstmgl/adrill:1.18.0

ARG APP_ROOT=/opt/drill

RUN chmod -R ugo+rw ${APP_ROOT}

RUN echo ${UID}

USER ${UID}

workdir ${DRILL_HOME}

ENTRYPOINT [ "drill-embedded" ]

但仍然无法正常工作,这是日志:

Error: Failure in starting embedded Drillbit: org.apache.drill.exec.exception.DrillbitStartupException: Failed to login. (state=,code=0)
java.sql.sqlException: Failure in starting embedded Drillbit: org.apache.drill.exec.exception.DrillbitStartupException: Failed to login.
    at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:143)
    at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:67)
    at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:67)
    at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
    at org.apache.drill.jdbc.Driver.connect(Driver.java:75)
    at sqlline.DatabaseConnection.connect(DatabaseConnection.java:135)
    at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:192)
    at sqlline.Commands.connect(Commands.java:1364)
    at sqlline.Commands.connect(Commands.java:1244)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
    at sqlline.sqlLine.dispatch(sqlLine.java:730)
    at sqlline.sqlLine.initArgs(sqlLine.java:410)
    at sqlline.sqlLine.begin(sqlLine.java:515)
    at sqlline.sqlLine.start(sqlLine.java:267)
    at sqlline.sqlLine.main(sqlLine.java:206)
Caused by: org.apache.drill.exec.exception.DrillbitStartupException: Failed to login.
    at org.apache.drill.exec.server.BootStrapContext.login(BootStrapContext.java:161)
    at org.apache.drill.exec.server.BootStrapContext.<init>(BootStrapContext.java:82)
    at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:171)
    at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:135)
    at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:133)
    ... 18 more
Caused by: org.apache.hadoop.security.KerberosAuthException: failure to login: javax.security.auth.login.LoginException: java.lang.NullPointerException: invalid null input: name
    at com.sun.security.auth.UnixPrincipal.<init>(UnixPrincipal.java:71)
    at com.sun.security.auth.module.UnixLoginModule.login(UnixLoginModule.java:133)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:755)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
    at org.apache.hadoop.security.UserGroupinformation$HadoopLoginContext.login(UserGroupinformation.java:1926)
    at org.apache.hadoop.security.UserGroupinformation.doSubjectLogin(UserGroupinformation.java:1837)
    at org.apache.hadoop.security.UserGroupinformation.createLoginUser(UserGroupinformation.java:710)
    at org.apache.hadoop.security.UserGroupinformation.getLoginUser(UserGroupinformation.java:660)
    at org.apache.drill.exec.server.BootStrapContext.login(BootStrapContext.java:156)
    at org.apache.drill.exec.server.BootStrapContext.<init>(BootStrapContext.java:82)
    at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:171)
    at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:135)
    at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:133)
    at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:67)
    at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:67)
    at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
    at org.apache.drill.jdbc.Driver.connect(Driver.java:75)
    at sqlline.DatabaseConnection.connect(DatabaseConnection.java:135)
    at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:192)
    at sqlline.Commands.connect(Commands.java:1364)
    at sqlline.Commands.connect(Commands.java:1244)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
    at sqlline.sqlLine.dispatch(sqlLine.java:730)
    at sqlline.sqlLine.initArgs(sqlLine.java:410)
    at sqlline.sqlLine.begin(sqlLine.java:515)
    at sqlline.sqlLine.start(sqlLine.java:267)
    at sqlline.sqlLine.main(sqlLine.java:206)

    at org.apache.hadoop.security.UserGroupinformation.doSubjectLogin(UserGroupinformation.java:1847)
    at org.apache.hadoop.security.UserGroupinformation.createLoginUser(UserGroupinformation.java:710)
    at org.apache.hadoop.security.UserGroupinformation.getLoginUser(UserGroupinformation.java:660)
    at org.apache.drill.exec.server.BootStrapContext.login(BootStrapContext.java:156)
    ... 22 more
Caused by: javax.security.auth.login.LoginException: java.lang.NullPointerException: invalid null input: name
    at com.sun.security.auth.UnixPrincipal.<init>(UnixPrincipal.java:71)
    at com.sun.security.auth.module.UnixLoginModule.login(UnixLoginModule.java:133)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:755)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
    at org.apache.hadoop.security.UserGroupinformation$HadoopLoginContext.login(UserGroupinformation.java:1926)
    at org.apache.hadoop.security.UserGroupinformation.doSubjectLogin(UserGroupinformation.java:1837)
    at org.apache.hadoop.security.UserGroupinformation.createLoginUser(UserGroupinformation.java:710)
    at org.apache.hadoop.security.UserGroupinformation.getLoginUser(UserGroupinformation.java:660)
    at org.apache.drill.exec.server.BootStrapContext.login(BootStrapContext.java:156)
    at org.apache.drill.exec.server.BootStrapContext.<init>(BootStrapContext.java:82)
    at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:171)
    at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:135)
    at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:133)
    at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:67)
    at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:67)
    at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
    at org.apache.drill.jdbc.Driver.connect(Driver.java:75)
    at sqlline.DatabaseConnection.connect(DatabaseConnection.java:135)
    at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:192)
    at sqlline.Commands.connect(Commands.java:1364)
    at sqlline.Commands.connect(Commands.java:1244)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
    at sqlline.sqlLine.dispatch(sqlLine.java:730)
    at sqlline.sqlLine.initArgs(sqlLine.java:410)
    at sqlline.sqlLine.begin(sqlLine.java:515)
    at sqlline.sqlLine.start(sqlLine.java:267)
    at sqlline.sqlLine.main(sqlLine.java:206)

    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:856)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
    at org.apache.hadoop.security.UserGroupinformation$HadoopLoginContext.login(UserGroupinformation.java:1926)
    at org.apache.hadoop.security.UserGroupinformation.doSubjectLogin(UserGroupinformation.java:1837)
... 25 more
Apache Drill 1.18.0
"Two things are infinite: the universe and Drill; and I'm not sure about the universe."

解决方法

您的应用程序需要root访问权限

您可以在FROM语句之后将User root添加到dockerfile中。

oc adm policy add-scc-to-user anyuid -z default -n <yournamespace>

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...