运行 OpenShift 上的 Apache Drill 在启动时失败
Running Apache Drill on OpenShift fails at startup
有没有在 openshift 上使用 运行ning apache drill 的经验?
我在尝试 运行 openshift 中的标准 docker 图像时遇到问题
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
但是一旦启动,这是由于日志目录导致启动失败的反馈:
我相信这可能是因为有关安全的准则。
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
知道我做错了什么吗?我将很快用实际启动错误更新它,它是相当基本的,但我相信这是用户 运行 应用程序的问题,只是不确定如何解决它。
ERROR: Drill config file not readable: /opt/drill/conf/drill-override.conf - Wrong user?
无论如何,我在 docker 文件
中也将图像更改为类似的内容
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[=15=]0(LoginContext.java:195)
at javax.security.auth.login.LoginContext.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext.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[=15=]0(LoginContext.java:195)
at javax.security.auth.login.LoginContext.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext.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[=15=]0(LoginContext.java:195)
at javax.security.auth.login.LoginContext.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext.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 权限,试试这个
您可以在 dockerfile 中的 FROM 语句之后添加 User root
。
或
oc adm policy add-scc-to-user anyuid -z default -n <yournamespace>
我自己也遇到过这个问题,经过一些艰苦的谷歌搜索,阅读了几次 post 和一些 OpenShift 文档,我偶然发现了解决这个问题的方法。
您在日志中看到的问题表明名称有问题,如果您查看 sqlline.log,您会看到 user.name 和 user.home 是空的 - 它看起来像这样:
INFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.name=?
INFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.home=?
似乎不是每个人都知道这一点,但基本上 OpenShift 在 pod 创建时生成用户 ID,用户没有家或名字,但在 OpenShift 的旧版本文档中,他们提供了一种生成 'default' 对于用户名:
https://docs.openshift.com/container-platform/3.10/creating_images/guidelines.html#openshift-specific-guidelines
具体来说,您希望图像中有此 uid_entrypoint 脚本,您可以 运行 为您的 100xxxxx 用户生成默认值:
https://github.com/RHsyseng/container-rhel-examples/blob/master/starter-arbitrary-uid/bin/uid_entrypoint
您需要确保在构建图像时更改 /etc/passswd 的权限,以便在启动图像时能够修改它
完成此操作后,我可以启动 Drill,您应该会在日志文件 sqlline.log:
中看到更新的 user.name 和 user.home
INFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.name=default
INFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.home=/
有没有在 openshift 上使用 运行ning apache drill 的经验?
我在尝试 运行 openshift 中的标准 docker 图像时遇到问题 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
但是一旦启动,这是由于日志目录导致启动失败的反馈:
我相信这可能是因为有关安全的准则。 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
知道我做错了什么吗?我将很快用实际启动错误更新它,它是相当基本的,但我相信这是用户 运行 应用程序的问题,只是不确定如何解决它。
ERROR: Drill config file not readable: /opt/drill/conf/drill-override.conf - Wrong user?
无论如何,我在 docker 文件
中也将图像更改为类似的内容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[=15=]0(LoginContext.java:195)
at javax.security.auth.login.LoginContext.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext.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[=15=]0(LoginContext.java:195)
at javax.security.auth.login.LoginContext.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext.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[=15=]0(LoginContext.java:195)
at javax.security.auth.login.LoginContext.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext.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 权限,试试这个
您可以在 dockerfile 中的 FROM 语句之后添加 User root
。
或
oc adm policy add-scc-to-user anyuid -z default -n <yournamespace>
我自己也遇到过这个问题,经过一些艰苦的谷歌搜索,阅读了几次 post 和一些 OpenShift 文档,我偶然发现了解决这个问题的方法。
您在日志中看到的问题表明名称有问题,如果您查看 sqlline.log,您会看到 user.name 和 user.home 是空的 - 它看起来像这样:
INFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.name=?
INFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.home=?
似乎不是每个人都知道这一点,但基本上 OpenShift 在 pod 创建时生成用户 ID,用户没有家或名字,但在 OpenShift 的旧版本文档中,他们提供了一种生成 'default' 对于用户名: https://docs.openshift.com/container-platform/3.10/creating_images/guidelines.html#openshift-specific-guidelines
具体来说,您希望图像中有此 uid_entrypoint 脚本,您可以 运行 为您的 100xxxxx 用户生成默认值: https://github.com/RHsyseng/container-rhel-examples/blob/master/starter-arbitrary-uid/bin/uid_entrypoint
您需要确保在构建图像时更改 /etc/passswd 的权限,以便在启动图像时能够修改它
完成此操作后,我可以启动 Drill,您应该会在日志文件 sqlline.log:
中看到更新的 user.name 和 user.homeINFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.name=default
INFO o.apache.drill.exec.server.Drillbit - Drillbit environment: user.home=/