If you want to use a graphical interface to manage files in HDFS, you can use Hue. This topic describes how to view and manage files and directories in HDFS on the Hue web UI. In this topic, an E-MapReduce (EMR) V4.9.0 cluster is used.

Prerequisites

  • A security group rule is configured. For more information, see Security groups.
    Notice When you configure the authorization object in the security group rule, enter only the CIDR blocks or IP addresses that need to access Hue. Do not enter the CIDR block 0.0.0.0/0.
  • Port 8888 is enabled. For more information, see Access the web UIs of open source components.

Considerations

For a Hadoop cluster of EMR V3.35.0 or a later minor version, or EMR V4.9.0 or a later minor version, you must delete filebrowser from the value of the app_blacklist parameter on the Configure tab of the Hue service page.

Go to the File Browser page

  1. Go to the Cluster Overview page of your cluster.
    1. Log on to the Alibaba Cloud EMR console by using your Alibaba Cloud account.
    2. In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
    3. Click the Cluster Management tab.
    4. On the Cluster Management page, find your cluster and click Details in the Actions column.
  2. Modify the app_blacklist parameter.
    1. In the left-side navigation pane, choose Cluster Service > Hue.
    2. In the Configuration Filter section, search for the app_blacklist parameter.
    3. Delete filebrowser from the value of the app_blacklist parameter.
      filebrowser
    4. In the upper-right corner of the Service Configuration section, click Save.
    5. In the Confirm Changes dialog box, specify Description and click OK.
  3. Restart Hue.
    1. In the upper-right corner of the Hue service page, choose Actions > Restart Hue.
    2. In the Cluster Activities dialog box, specify Description and click OK.
    3. In the Confirm message, click OK.
  4. Start the HttpFS component of the HDFS service.
    1. In the left-side navigation pane, choose Cluster Service > HDFS.
    2. Click the Component Deployment tab.
    3. Find the HttpFS component and click Start in the Actions column.
      httpfs
    4. In the Cluster Activities dialog box, specify Description and click OK.
    5. In the Confirm message, click OK.
      You can click History in the upper-right corner to view the status of the Start HDFS HttpFS task. After the task enters the Successful state, the HttpFS component is started.
  5. In the left-side navigation pane, click Connect Strings.
  6. On the Public Connect Strings page, click the URL of Hue.
    On the page that appears, enter your Hue username and password to access the Hue web UI.
    Note The first time you log on to the Hue web UI, you must obtain the initial password of the admin account, which is the default administrator. For more information about how to obtain the initial password, see View the initial password.
  7. In the left-side navigation pane, click the file icon.
    The File Browser page appears. You can view information about the directories and files that belong to the current account. File Browser
    Parameter Description
    Name The name of the directory or file.
    Size The size of the file.
    User The owner of the directory or file.
    Group The group to which the directory or file belongs.
    Permissions The permissions on the directory or file.
    Date The time when the directory or file was created.

Manage directories or files

  1. On the File Browser page, select one or more directories or files.
  2. Select an option from the Actions drop-down list on the top of the page.
    Actions
    Action Description
    Rename Rename a directory or file.
    Move Move files. In the Move to dialog box, select a new directory and click Move to move the selected files to the new directory.
    Copy Copy directories or files.
    Download Download files to your computer.
    Change permissions Modify the access permissions on directories or files.
    • Read, Write, and Execute: You can grant the owner, the group, or other users the Read, Write, and Execute permissions.
    • Sticky: indicates that only HDFS administrators, directory owners, and file owners can move files in the selected directories.
    • Recursive: indicates that permissions are granted to subdirectories recursively.
    Summary View the HDFS storage information about directories or files.
    Set replication Set a replication factor for files.
    Compress Compress directories or files.
    Notice Before you perform this operation, you must add the Oozie service to your EMR cluster. For more information about how to add a service, see Add a service.

Upload files

  1. On the File Browser page, click Upload in the upper-right corner.
  2. In the dialog box that appears, click Select files.
  3. Select the files that you want to upload and click Open.

Create a file and a directory

  • Create a file
    1. On the File Browser page, choose New > File in the upper-right corner.
    2. In the Create File dialog box, specify File Name.
    3. Click Create.
  • Create a directory
    1. On the File Browser page, choose New > Directory.
    2. In the Create Directory dialog box, specify Directory Name.
    3. Click Create.