最近搭建zeppelin,单独起了一台spark-thriftserver,进行hive库的查询。遇到了N多坑,这边记录一下几个主要的地方。
当然,有zeppelin相关的疑问也欢迎在文末评论!
1、无法启动
有好多种可能,详细可以查看/logs中得日志。
可能是没有创建Log/Pid目录。
可能是没有正确安装JDK,或者版本不对。
确认JDK和系统版本:(我用的zeppelin版本为当前最新:0.7.3)
2、zeppelin ip+端口可以访问,绑定域名无法访问
我用的是8089端口,直接ip+端口,一切正常。
如果把域名映射成ip+端口,则无法访问。
正常情况:
不正常情况为红色的点,websocket disconnected
仔细研究了一下,域名映射的时候:
NGINX 通过在客户端和后端服务器之间建立起一条隧道来支持WebSocket。为了使NGINX可以将来自客户端的Upgrade请求发送给
后端服务器,Upgrade和Connection的头信息必须被显式的设置。
location /ws {
proxy_pass http://zepplin;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
3、Zeppelin用户登录认证
Zeppelin采用的是shiro认证,去/conf/shiro.ini 中配置,里面的roles为用户组,users为用户。
一个用户组可以包含多个用户,一个用户也可以属于多个用户组。
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND