Linking Object Storage + Sub Account
    • PDF

    Linking Object Storage + Sub Account

    • PDF

    Article Summary

    Available in Classic

    This page introduces the method for linking and using the Cloud Hadoop, Object Storage, and Sub Account of NAVER Cloud Platform.

    Bigdata Service

    • Cloud Hadoop: You can easily establish open source frameworks such as Hadoop, HBase, Spark, Hive and Presto.
      Please refer Cloud Hadoop overview for more information about Cloud Hadoop.

    • Object Storage: It can be used for data that requires safe storage or large in volume.
      It can also be used for backup and restoration of server data with the provided APIs.
      Please refer Object Storage overview for more information about Object Storage.

    • Sub Account: You can register users as sub accounts and grant permissions for specific services.
      The registered users can use the service for which they have been authorized in the same manner as their main account.
      Please refer Sub Account Guide for more information about Sub Account.

    Create Sub Account and add policies

    You can register users as sub accounts and grant permissions for specific services. The registered users can use the service, for which they have been authorized, in the same manner as their main account.

    Please refer to the Sub Account Guide for more information about Sub Account.

    The following describes how to create Sub Account and add policies.

    1. Create the Sub Accounts service from the NAVER Cloud Platform console.

      • When you create Sub Accounts, select and set API access under the access type item so the API keys can be used for accessing Object Storage.
        cloudhadoop-subaccoun-policy1_en
    2. Select the Sub Account created from the list of Sub Accounts, and set the usage policy in the [Policy] tab.

      • Add NCP_CLOUD_HADOOP_MANAGER policy from Cloud Hadoop.
      • Add the NCP_OBJECT_STORAGE_MANAGER policy of Object Storage.
      • Add NCP_SERVER_MANAGER policy for ACG change management.
        cloudhadoop-subaccoun-policy2_en
    3. Create and check the API authentication key for the Object Storage access from the [API Key] tab.
      cloudhadoop-subaccoun-policy3_en

    4. Log in with the Sub Account from Sub Account > Dashboard > Sub account login page.

      • The sub account ID is the Login ID set when creating the sub account.
      • The password is the Login password set when creating the sub account.
        cloudhadoop-subaccoun-policy4_en
    • You can only use the services allowed by the policies set for the account.
      hadoop-chadoop-use-ex3_07_ko

    Create Object Storage bucket

    Create a bucket to save data in Object Storage. The created bucket can be viewed from the Bucket Management menu.

    Note

    Please refer to Object Storage Guide for more information about creating buckets.

    Create Cloud Hadoop cluster

    Create a Cloud Hadoop cluster.
    Please refer to Getting started with Cloud Hadoop for more information about creating Cloud Hadoop.

    Upload the sample data to Object Storage

    1. Download the dataset from here.
      • Decompress the downloaded file.
    2. Upload the decompressed file to the bucket created at Object Storage > Bucket Management.
      cloudhadoop-objectstorage-buket1_en

    Data query

    You can search the sample data from web UIs such as Ambari, HUE, Zeppelin, etc.

    1. Once the Cloud Hadoop creation is complete, please add ports to connect to Ambari, HUE, and Zeppelin on ACG.
    2. Connect to HUE (Port 8000), create a mart database with a Hive query, and then create an Orders table.
    CREATE DATABASE mart;
    

    hadoop-use-ex-hivequery_C_ko

    1. Look up the data.
    CREATE EXTERNAL TABLE `orders2` (
            `order_id` BIGINT,
            `order_number` BIGINT,
            `days_since_prior_order` DOUBLE
    
    )
    ROW FORMAT DELIMITED
    FIELDS TERMINATED BY ','
    STORED AS INPUTFORMAT
    'org.apache.hadoop.mapred.TextInputFormat'
    OUTPUTFORMAT
    'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
    location 's3a://ncp-bigdata/';
    

    hadoop-use-ex-hivetable_C_ko

    1. Connect to Zeppelin (Port 9995).
    SELECT * FROM orders2;
    

    hadoop-use-ex3_4-2_C_ko

    1. Connect to Zeppelin (port 9995).
    2. Click [Notebook] > Create new note and create a new Zeppelin Notebook.
      hadoop-use-ex3_4-3_C_ko
    3. After setting the Default Interpreter to jdbc, click the [Create] button.
      hadoop-use-ex3_4-3-interpreter_C_ko
    4. Search the orders2 table registered on the Hive metastore.
    %jdbc(hive)
    SELECT order_number, AVG(days_since_prior_order)
    FROM mart.orders2
    WHERE 1=1
    AND order_number IS NOT NULL
    GROUP BY order_number
    ORDER BY order_number
    
    • Proceed with a simple analysis of the CSV file, which was uploaded as an example.
    • With the assumption that more orders result in shorter reorder terms, proceed with verification.

    <Orders2 table>

    • order_id: order number
    • order_number: number of orders
    • days_since_prior: time since last order
    Note

    This virtual data is created as an example referring to the data provided by Instacart.

    1. Search the Hive table (orders2) created from HUE using Cloud Hadoop from Zeppelin, and then visualize it into a chart as follows.
      hadoop-use-ex3_4-4_C_ko

    When you take a look at the chart, you can assume that customers with higher number of orders have shorter time before the next reorder.

    Note
    • If you use Object Storage, then its performance is inferior to HDFS. However, it has the advantage of being able to search the same data, even after shutting down the cluster, by creating the cluster again when needed.
    • Since the Hive metastore has not been separated, Hive DDL needs to be executed for new creations, and the Zeppelin Notebook also has to be newly imported.

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.