运行 zeppelin 在 docker 图像中时如何为口译员设置用户解释?
How to set up user interpretation for interpreters when running zeppelin in a docker image?
我正在 zeppelin docker image. Now I'm packing my own configuration into my own docker image. I've got it connected to LDAP for logging in and for user impersonation. Like this 的基础上设置一个 docker 图像,覆盖 zeppelin-env.sh.
中的 ZEPPELINIMPERSONATECMD
运行 whoami
与 sh 解释器现在工作正常。 运行ning id
也显示了来自 ldap 的所有正确用户信息。
然而,当我将 python 解释器切换到每个用户隔离设置并打开用户解释时,它将失败并在注释本身中显示 ImportError[1] 响应。服务器日志记录看起来像这样 [2],我用 user_name
.
替换了我的用户名
我试过不覆盖 zeppelin-env.sh 中的 ZEPPELINIMPERSONATECMD。这只会导致 运行 时间异常[3] 运行 任何事情。
我尝试将 /zeppelin/interpreter/python/py4j-0.9.2/src/py4j 文件夹复制到 /tmp,但这只会在 10 秒后导致 python not responding
。
有没有人知道如何运行 python 解释器作为登录用户?
[1]:
Traceback (most recent call last):
File "/tmp/zeppelin_python-702917387527627656.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
Traceback (most recent call last):
File "/tmp/zeppelin_python-702917387527627656.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
python is not responding
[2]:
INFO [2019-08-14 15:13:14,716] ({pool-2-thread-2} ShellScriptLauncher.java[launch]:48) - Launching Interpreter: python
INFO [2019-08-14 15:13:14,727] ({pool-2-thread-2} RemoteInterpreterManagedProcess.java[start]:115) - Thrift server for callback will start. Port: 40221
INFO [2019-08-14 15:13:14,738] ({pool-2-thread-2} RemoteInterpreterManagedProcess.java[start]:190) - Run interpreter process [/zeppelin/bin/interpreter.sh, -d, /zeppelin/interpreter/python, -c, 172.17.0.3, -p, 40221, -r, :, -u, user_name, -l, /zeppelin/local-repo/python, -g, python]
INFO [2019-08-14 15:13:16,400] ({pool-7-thread-1} RemoteInterpreterManagedProcess.java[callback]:123) - RemoteInterpreterServer Registered: CallbackInfo(host:172.17.0.3, port:40445)
INFO [2019-08-14 15:13:16,440] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonInterpreter
INFO [2019-08-14 15:13:16,540] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.IPythonInterpreter
INFO [2019-08-14 15:13:16,544] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonInterpreterPandasSql
INFO [2019-08-14 15:13:16,545] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonCondaInterpreter
INFO [2019-08-14 15:13:16,547] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonDockerInterpreter
INFO [2019-08-14 15:13:16,549] ({pool-2-thread-2} RemoteInterpreter.java[call]:142) - Open RemoteInterpreter org.apache.zeppelin.python.PythonInterpreter
INFO [2019-08-14 15:13:16,549] ({pool-2-thread-2} RemoteInterpreter.java[pushAngularObjectRegistryToRemote]:436) - Push local angular object registry from ZeppelinServer to remote interpreter group python:user_name:
WARN [2019-08-14 15:13:27,703] ({pool-2-thread-2} NotebookServer.java[afterStatusChange]:2316) - Job 20190814-151311_1784127416 is finished, status: ERROR, exception: null, result: %text Traceback (most recent call last):
File "/tmp/zeppelin_python-4627212054430132450.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
%text Traceback (most recent call last):
File "/tmp/zeppelin_python-4627212054430132450.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
%text python is not responding
INFO [2019-08-14 15:13:27,713] ({pool-2-thread-2} VFSNotebookRepo.java[save]:196) - Saving note:2EJWQC1Y4
INFO [2019-08-14 15:13:27,715] ({pool-2-thread-2} SchedulerFactory.java[jobFinished]:120) - Job 20190814-151311_1784127416 finished by scheduler org.apache.zeppelin.interpreter.remote.RemoteInterpreter-python:user_name:-shared_session
[3]:
java.lang.RuntimeException: ssh: connect to host localhost port 22: Cannot assign requested address
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterManagedProcess.start(RemoteInterpreterManagedProcess.java:205)
at org.apache.zeppelin.interpreter.ManagedInterpreterGroup.getOrCreateInterpreterProcess(ManagedInterpreterGroup.java:64)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getOrCreateInterpreterProcess(RemoteInterpreter.java:111)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:164)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:132)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:299)
at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:407)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:315)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
我设法通过添加解决了这个问题:
export PYTHONPATH=/zeppelin/interpreter/python/py4j-0.9.2/src
齐柏林飞艇-env.sh.
之后解释器 运行 很好。
我正在 zeppelin docker image. Now I'm packing my own configuration into my own docker image. I've got it connected to LDAP for logging in and for user impersonation. Like this 的基础上设置一个 docker 图像,覆盖 zeppelin-env.sh.
中的 ZEPPELINIMPERSONATECMD运行 whoami
与 sh 解释器现在工作正常。 运行ning id
也显示了来自 ldap 的所有正确用户信息。
然而,当我将 python 解释器切换到每个用户隔离设置并打开用户解释时,它将失败并在注释本身中显示 ImportError[1] 响应。服务器日志记录看起来像这样 [2],我用 user_name
.
我试过不覆盖 zeppelin-env.sh 中的 ZEPPELINIMPERSONATECMD。这只会导致 运行 时间异常[3] 运行 任何事情。
我尝试将 /zeppelin/interpreter/python/py4j-0.9.2/src/py4j 文件夹复制到 /tmp,但这只会在 10 秒后导致 python not responding
。
有没有人知道如何运行 python 解释器作为登录用户?
[1]:
Traceback (most recent call last):
File "/tmp/zeppelin_python-702917387527627656.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
Traceback (most recent call last):
File "/tmp/zeppelin_python-702917387527627656.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
python is not responding
[2]:
INFO [2019-08-14 15:13:14,716] ({pool-2-thread-2} ShellScriptLauncher.java[launch]:48) - Launching Interpreter: python
INFO [2019-08-14 15:13:14,727] ({pool-2-thread-2} RemoteInterpreterManagedProcess.java[start]:115) - Thrift server for callback will start. Port: 40221
INFO [2019-08-14 15:13:14,738] ({pool-2-thread-2} RemoteInterpreterManagedProcess.java[start]:190) - Run interpreter process [/zeppelin/bin/interpreter.sh, -d, /zeppelin/interpreter/python, -c, 172.17.0.3, -p, 40221, -r, :, -u, user_name, -l, /zeppelin/local-repo/python, -g, python]
INFO [2019-08-14 15:13:16,400] ({pool-7-thread-1} RemoteInterpreterManagedProcess.java[callback]:123) - RemoteInterpreterServer Registered: CallbackInfo(host:172.17.0.3, port:40445)
INFO [2019-08-14 15:13:16,440] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonInterpreter
INFO [2019-08-14 15:13:16,540] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.IPythonInterpreter
INFO [2019-08-14 15:13:16,544] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonInterpreterPandasSql
INFO [2019-08-14 15:13:16,545] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonCondaInterpreter
INFO [2019-08-14 15:13:16,547] ({pool-2-thread-2} RemoteInterpreter.java[call]:168) - Create RemoteInterpreter org.apache.zeppelin.python.PythonDockerInterpreter
INFO [2019-08-14 15:13:16,549] ({pool-2-thread-2} RemoteInterpreter.java[call]:142) - Open RemoteInterpreter org.apache.zeppelin.python.PythonInterpreter
INFO [2019-08-14 15:13:16,549] ({pool-2-thread-2} RemoteInterpreter.java[pushAngularObjectRegistryToRemote]:436) - Push local angular object registry from ZeppelinServer to remote interpreter group python:user_name:
WARN [2019-08-14 15:13:27,703] ({pool-2-thread-2} NotebookServer.java[afterStatusChange]:2316) - Job 20190814-151311_1784127416 is finished, status: ERROR, exception: null, result: %text Traceback (most recent call last):
File "/tmp/zeppelin_python-4627212054430132450.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
%text Traceback (most recent call last):
File "/tmp/zeppelin_python-4627212054430132450.py", line 20, in <module>
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
ImportError: No module named py4j.java_gateway
%text python is not responding
INFO [2019-08-14 15:13:27,713] ({pool-2-thread-2} VFSNotebookRepo.java[save]:196) - Saving note:2EJWQC1Y4
INFO [2019-08-14 15:13:27,715] ({pool-2-thread-2} SchedulerFactory.java[jobFinished]:120) - Job 20190814-151311_1784127416 finished by scheduler org.apache.zeppelin.interpreter.remote.RemoteInterpreter-python:user_name:-shared_session
[3]:
java.lang.RuntimeException: ssh: connect to host localhost port 22: Cannot assign requested address
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterManagedProcess.start(RemoteInterpreterManagedProcess.java:205)
at org.apache.zeppelin.interpreter.ManagedInterpreterGroup.getOrCreateInterpreterProcess(ManagedInterpreterGroup.java:64)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getOrCreateInterpreterProcess(RemoteInterpreter.java:111)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:164)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:132)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:299)
at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:407)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:315)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
我设法通过添加解决了这个问题:
export PYTHONPATH=/zeppelin/interpreter/python/py4j-0.9.2/src
齐柏林飞艇-env.sh.
之后解释器 运行 很好。