Installation and use of zepplin

1. Download the installation package

Official website direct

Select zeppelin-0.8.1-bin-all.tgz

image-20200919135439880

2. Upload the installation package

Upload to Linux optfolder and unzip

tar -zvxf zeppelin-0.8.1-bin-all.tgz

Renamed

mv zeppelin-0.8.1-bin-all zpln

3. Modify the configuration file

  • Enter zplnthe conffolder below

3.1 Modify zeppelin-site.xml file

mv zeppelin-site.xml.template zeppelin-site.xml

Enter file

vi zeppelin-site.xml

Modify the port number: the default is 8080, in order to avoid conflicts, modify it to other port numbers such as 8000

<property>
  <name>zeppelin.server.port</name>
  <value>8000</value>
  <description>Server port.</description>
</property>

image-20200919143114189

3.2 Modify zeppelin-env.sh file

mv zeppelin-env.sh.template zeppelin-env.sh

Add JAVA_HOME and HADOOP_CONF_DIR (specify your own java and hadoop installation directory)

vi zeppelin-env.sh

Add to

export JAVA_HOME=/opt/jdk1.8.0_221
export HADOOP_CONF_DIR=/opt/hadoop/etc/hadoop

image-20200919143545988

4. Start zeppelin

Enter the bin directory to execute

./zeppelin-daemon.sh start 

Visit 192.168.83.100:8000 (host ip: set port number)

image-20200919143731696

Close zepplin

./zeppelin-daemon.sh stop

5. Configure hive interpreter

There is no default hive interpreter in Zepplin, but we can add it through the jdbc interpreter.

5.1 Environment and variable configuration

  • Copy the hive configuration file hive-site.xmlto zpln/conf.
cp /opt/hive/conf/hive-site.xml /opt/zpln/conf/
  • Copy the jar package

Copy the following two jar packages to the interperter in the zeppelin installation directory. (The version is determined according to the version installed by yourself)

cp /opt/hadoop/share/hadoop/common/hadoop-common-2.6.0-cdh5.14.2.jar /opt/zpln/interpreter/jdbc
cp /opt/hive/lib/hive-jdbc-1.1.0-cdh5.14.2-standalone.jar /opt/zpln/interpreter/jdbc

5.2 Configure integrated hive on the web interface

  • In the upper right corner anonymous --> interpreter --> +Create a new integrated environment called hive

image-20200919144212580

image-20200919144218958

  • Set properties
default.driver   org.apache.hive.jdbc.HiveDriver
default.url     jdbc:hive2://192.168.42.200:10000
default.user    root

image-20200919144307179

Click Save and restart the hive interpreter.

  • Background startup and hiveserver2

nohup hive --service hiveserver2 &

6. Use Zepplin's hive interpreter

In Zepplin, click on notebook to create a notebook through create new note.

The name can be any, and the Default Interpreter select hive.

image-20200919144421158

Verify hive interpreter ( 注意,zepplin中操作hive不能有分号)

%hive
show databases

image-20200919144454595

Guess you like

Origin blog.csdn.net/zmzdmx/article/details/108680935