However, before you can use interpreters, in most cases you need to configure them (e.g. point hive interpreter to server/port where HiveServer2 is running on your cluster). You can do this manually via the Zeppelin UI by clicking on the Interpreter tab.
However, in some cases you will want to automate/script out this step. Below is some sample code on how to do this. To run, on the host where Zeppelin is running, copy/paste the code into a file called zeppelin.py using your favourite editor, and then run it by typing:
First it is connecting to Zeppelin REST API on port 9995 and fetching the configs for hive and psql interpreters
Then it is updating hive interpreter configs (by setting the HS2 url to jdbc:hive2://localhost:10000) and posting the updated config back to Zeppelin
Finally it is updating psql interpreter configs (by setting the username/pass and udpating psql url to
jdbc:postgresql://localhost:10432/postgres) and posting the updated config back to Zeppelin
Sample output is shown below. For each request made, it will output OK if the POST request succeeded.
# python zeppelin.py
OK
OK
Also if your urls/credentials are different from above, feel free to modify the python script and re-run the script (you can re-run the script as many times as you like)
Now if you open your Zeppelin interpreter tab, you will notice that the Hive and psql interpreters have been updated with above configs.