sposetti 7b77f4dc64 AMBARI-8536: Views: Files, UI and trash 10 سال پیش
..
src 7b77f4dc64 AMBARI-8536: Views: Files, UI and trash 10 سال پیش
pom.xml a61271583c AMBARI-8403. Views: Files download of ZIP fails on folder with no permissions (alexantonenko) 10 سال پیش
readme.md 7b77f4dc64 AMBARI-8536: Views: Files, UI and trash 10 سال پیش

readme.md

Files View

Description

This View provides a UI to browse HDFS, create directories and upload + download files.

Requirements

  • Ambari 1.7.0
  • HDFS with WebHDFS configured

Build

The view can be built as a maven project.

mvn clean install

The build will produce the view archive.

target/files-0.1.0-SNAPSHOT.jar

Place the view archive on the Ambari Server and restart to deploy.

cp files-0.1.0-SNAPSHOT.jar /var/lib/ambari-server/resources/views/
ambari-server restart

View Definition

<parameter>
    <name>webhdfs.url</name>
    <description>WebHDFS FileSystem URI (example: webhdfs://namenode:50070)</description>
    <required>true</required>
</parameter>
<parameter>
    <name>webhdfs.username</name>
    <description>User and doAs for proxy user for HDFS</description>
    <required>false</required>
</parameter>

Cluster Configuration

Configure HDFS for a proxy user. In core-site.xml, add the following properties:

hadoop.proxyuser.root.hosts=*
hadoop.proxyuser.root.groups=*

Create Hadoop users and make members of the hdfs, hadoop and users groups. For example, to create a user "admin":

useradd -G hdfs admin
usermod -a -G users admin
usermod -a -G hadoop admin

Check the "admin" user has the correct group membership.

id admin
uid=1002(admin) gid=1002(admin) groups=1002(admin),100(users),503(hadoop),498(hdfs)

Deploying the View

Use the Ambari Vagrant setup to create a cluster:

Deploy the Files view into Ambari.

cp files-0.1.0-SNAPSHOT.jar /var/lib/ambari-server/resources/views/
ambari-server restart

From the Ambari Administration interface, create a Files view instance.

Property Value
Details: Instance Name FILES_1
Details: Display Name Files
Details: Description Browse HDFS files and directories
Properties: webhdfs.url webhdfs://c6401.ambari.apache.org:50070

Login to Ambari as "admin" and browse to the view instance.

http://c6401.ambari.apache.org:8080/#/main/views/FILES/0.1.0/FILES_1

Optional: Development with Local Vagrant VM

After deploying the view into a Vagrant VM, if you want to perform view development from your local build, perform the following:

Browse to the work directory.

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

Remove the FILES{0.1.0} directory.

rm FILES\{0.1.0\}

Create a link to your local build.

ln -s /vagrant/ambari/contrib/views/files/target/classes/ FILES\{0.1.0\}

Restart Ambari Server.

ambari-server restart