Support Questions

Find answers, ask questions, and share your expertise

Custom ambari view not showing in the view menu after deploying

avatar
Contributor

Hello,

I am trying to deploy my custom view in the Ambari. However, I cannot see my custom view after deploying. I am following the procedure given here: Ambari-View Example, mainly following the basic view: HelloWorld.

After downloading the code, I followed the below procedure

  1. Obtain the View package. For example, helloworld-view-1.0-SNAPSHOT.jar.
  2. On the Ambari Server host, browse to the views directory.

    cd /var/lib/ambari-server/resources/views

  3. Copy the helloworld-view-1.0-SNAPSHOT.jar into this folder.
  4. Restart Ambari Server.

    ambari-server restart

  5. Check in the Ambari web UI -> View menu,

  6. Nothing is displayed. Log is also showing nothing suspicious.

Log:

17 Aug 2017 09:53:18,467  INFO [pool-5-thread-1] ViewDirectoryWatcher:118 - Event ENTRY_CREATE: /var/lib/ambari-server/resources/views/helloworld-view-1.0-SNAPSHOT.jar


17 Aug 2017 09:53:18,467  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:18,668  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:18,868  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:19,068  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:19,268  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:19,469  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:19,671  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:19,872  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:20,072  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:20,273  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:20,477  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:20,678  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:20,879  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:21,079  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:21,281  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:21,482  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:21,683  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:21,884  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:22,085  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:22,286  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:22,486  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:22,687  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:22,888  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:23,089  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:23,290  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:23,491  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:23,691  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:23,894  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:24,095  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:24,297  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:24,498  INFO [pool-5-thread-1] ViewDirectoryWatcher:200 - Waiting for file to be completely copied
17 Aug 2017 09:53:24,698  INFO [pool-5-thread-1] ViewDirectoryWatcher:213 - File /var/lib/ambari-server/resources/views/helloworld-view-1.0-SNAPSHOT.jar has finished copying
17 Aug 2017 09:53:24,699  INFO [pool-5-thread-1] ViewDirectoryWatcher:128 - Starting view extraction
17 Aug 2017 09:53:24,716  INFO [pool-5-thread-1] ViewRegistry:1823 - Reading view archive /var/lib/ambari-server/resources/views/helloworld-view-1.0-SNAPSHOT.jar.
17 Aug 2017 09:53:24,718  INFO [pool-5-thread-1] ViewExtractor:86 - Creating archive folder /var/lib/ambari-server/resources/views/work/HELLO_WORLD{1.0.0}.
17 Aug 2017 09:53:24,719  INFO [pool-5-thread-1] ViewExtractor:93 - Extracting files from helloworld-view-1.0-SNAPSHOT.jar.
17 Aug 2017 09:53:24,749  INFO [pool-5-thread-1] ViewRegistry:1857 - View deployed: HELLO_WORLD{1.0.0}.
17 Aug 2017 09:53:24,749  INFO [pool-5-thread-1] ViewDirectoryWatcher:82 - Finished processing the view definition for/var/lib/ambari-server/resources/views/helloworld-view-1.0-SNAPSHOT.jar

POM.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <artifactId>helloworld-view</artifactId>
  <groupId>com.test.ambariview</groupId>
  <packaging>jar</packaging>
  <name>Ambari Hello World View</name>
  <version>1.0-SNAPSHOT</version>
  <url>http://maven.apache.org</url>

  <properties>
    <ambari.version>1.7.0.0</ambari.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>3.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ambari</groupId>
      <artifactId>ambari-views</artifactId>
      <version>${ambari.version}</version>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-server</artifactId>
      <version>1.8</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.12</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.0.1</version>
        <executions>
          <execution>
            <phase>none</phase>
            <goals>
              <goal>rpm</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>


am I missing anything else ?

Best Regards

Sayed Anisul Hoque

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Sayed Anisul Hoque

Looks like you logged in to ambari as "raj_ops" user. This user does not have permission to view the "Hello World View".

So login to ambari as "admin" with password "admin" user and then Navigate to :

Ambari UI --> "Admin" (Drop down top right corner) --> Manage Ambari --> Views --> "Hello world View" (Click here)

.

Now give the permission to the "raj_ops" user to see the view as following:

28416-hello-wold-view-permission.png

.

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Sayed Anisul Hoque

Login to Ambari UI --> "Admin" (Drop down top right corner) --> Manage Ambari --> Views --> "Hello world View" (something like this)

Click on the "Create Instance" button there and fill the details. And then it should be listed in the drop down menu of Views.

Also is there any specific reason that you are specifying 1.7.0 version for ambari there?


I used the following to test locally.

    <dependency>
      <groupId>org.apache.ambari</groupId>
      <artifactId>ambari-views</artifactId>
      <version>2.5.0.0</version>
    </dependency>

.

avatar
Contributor

@Jay SenSharma

Thank you for your quick reply. However, I cant see the menus that you have told. Please check the screenshots of the menus.

screen1:

28413-screen1.png

screen2:

28414-screen2.png

Moreover, I used this below repo earlier, but I was getting this issue. It seems it is not available. so, I tried with 2.0.0.0 version and then 1.7.0.0 version.

<dependency>
 <groupId>org.apache.ambari</groupId>
 <artifactId>ambari-views</artifactId>
 <version>2.5.0.0</version>
</dependency>

[ERROR] Failed to execute goal on project helloworld-view: Could not resolve dependencies for project com.test.ambariview:helloworld-view:jar:1.0-SNAPSHOT: Failure to find org.apache.ambari:ambari-views:jar:2.5.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are force

avatar
Master Mentor

@Sayed Anisul Hoque

Looks like you logged in to ambari as "raj_ops" user. This user does not have permission to view the "Hello World View".

So login to ambari as "admin" with password "admin" user and then Navigate to :

Ambari UI --> "Admin" (Drop down top right corner) --> Manage Ambari --> Views --> "Hello world View" (Click here)

.

Now give the permission to the "raj_ops" user to see the view as following:

28416-hello-wold-view-permission.png

.

avatar
Contributor

Fantastic !

It is now working.. Login into Admin account did the trick.

Thank you a bunch 🙂 @Jay SenSharma

If you have a time, can you please tell about the maven dependency. I am wondering, how you are able to use this dependency because I searched through the maven repo and the updated one is 2.0.0.0

<dependency>
	<groupId>org.apache.ambari</groupId>
	<artifactId>ambari-views</artifactId>
	<version>2.5.0.0</version>
</dependency>

However, I really appreciate your help. I was struggling with this for past 2 days ! phew ...