Hello World with Ambari Views

Previously, I gave a brief overview of what an Ambari View is and how it can be beneficial to you.Let’s dive in!

First, make sure you have IntelliJ installed on your computer with JDK 1.8 installed.


  1. Create a new Maven project!
    1. File>New>Project…>Choose your SDK location
    2. Enter your groupID (you can just make this up! org.hadoopsters.tutorials is fine) and artifactID (ambari-views)
    3. Pick a location to save this project, I like to keep all of my Ambari Views in one area: C:\Users\jbarney\IdeaProjects\ambai-views\<view-name>
    4. Click finish and you’ll have a new project!
  2. IntelliJ should open up to your project’s pom.xml, the dependency management file for Maven projects. You’ll want to make yours look like mine:
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns=""
  3. Now we add some files to our view!
    1. In the project’s structure, navigate to src>main>resources and create two files:
      1. index.html
                <title>Hello world!</title>
                <h1>Hello world!</h1>
      2. view.html
            <label>The Hello World View!</label>
    2. These two files are all you need to build your first Ambari View.
  4. Create your Ambari View’s jar file.
    1. Click File > Project Structure > Artifacts > + > Jar > From modules with dependencies > Ok
    2. Then click Apply and Ok at to confirm adding that artifact to your project
    3. Click Build > Build Artifacts > hello-world:jar > Build
    4. Should take a few seconds, if IntelliJ says it needs to import dependencies, allow it to.
  5. Now you should have a hell0-world.jar file sitting in hello-world>out>artifacts>hello_world_jar. We need to move that to our cluster. Use WinSCP or Filezilla or any other file transfer program to move it over.
  6. Log in as root where your Ambari Server is installed and copy the jar to /var/lib/ambari-server/resources/views/ambari-views
  7. Now restart Ambari
    ambari-server restart
  8. Navigate to http://your-ambari-server:8080/#/main/views/HELLO_WORLD/1.0.0/INSTANCE_1

All done! If everything worked, you should see HELLO WORLD in big bold <h1> letters!

For more information, go here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.