Help Center > > User Guide> Configuring Clusters> Bootstrap Actions> Sample Scripts

Sample Scripts

Updated at: Dec 15, 2019 GMT+08:00

Zeppelin

Zeppelin is a web-based notebook that supports interactive data analysis. For more information, visit the Zeppelin official website at http://zeppelin.apache.org/.

This sample script is used to automatically install Zeppelin. Select the corresponding script path based on the region where the cluster is to be created. Enter the script path in Script Path on the Bootstrap Action page when adding a bootstrap action during cluster creation. You do not need to enter parameters for this script. Based on the Zeppelin usage habit, you only need to run the script on the active Master node.

After the bootstrap action is complete, use either of the following methods to verify that Zeppelin is correctly installed.

Method 1: Log in to the active Master node as user root and run /home/apache/zeppelin-0.7.3-bin-all/bin/zeppelin-daemon.sh status. If the message stating "Zeppelin is running [ OK ]" is displayed, the installation is successful.

Method 2: Start a Windows ECS in the same VPC. Access port 7510 of the active Master node in the cluster. If the Zeppelin page is displayed, the installation is successful.

Presto

Presto is an open-source distributed SQL query engine, which is applicable to interactive analysis and query. For more information, visit the official website at http://prestodb.io/.

The sample script can be used to automatically install Presto. The script path is as follows:

Based on the Presto usage habit, you are advised to install dualroles on the active Master nodes and worker on the Core nodes. You are advised to add the boot operation script and configure the parameters as follows:

Table 1 Bootstrap action script parameters

Script 1

Name: install dualroles

Script Path: Select the path of the presto-install.sh script based on the region.

Execution Node: Active Master

Parameters: dualroles

Execution Time: After component start

Failed Action: Continue

Script 2

Name: install worker

Script Path: Select the path of the presto-install.sh script based on the region.

Execution Node: Core

Parameters: worker

Execution Time: After component start

Failed Action: Continue

After the bootstrap action is complete, you can start a Windows ECS in the same VPC of the cluster and access port 7520 of the active Master node to view the Presto web page.

You can also log in to the active Master node to try Presto and run the following commands as user root:

Command for loading the environment variable:

#source /opt/client/bigdata_env

Command for viewing the process status:

#/home/apache/presto/presto-server-0.201/bin/launcher status

Command for connecting to Presto and performing the operation

#/home/apache/presto/presto-server-0.201/bin/presto --server localhost:7520 --catalog tpch --schema sf100

presto:sf100> select * from nation;

presto:sf100> select count(*) from customer

Superset

Superset is a web-based enterprise-level and modern BI tool. For more information, visit the Superset official website at https://superset.incubator.apache.org/.

This sample script is used to automatically install Superset. Select the corresponding script path based on the region where the cluster is to be created. Enter the script path in Script Path on the Bootstrap Action page when adding a bootstrap action during cluster creation. You do not need to enter parameters for this script. Based on the Superset usage habit, you only need to run the script on the active Master node.

After the bootstrap action is complete, use either of the following methods to verify that Superset is correctly installed.

Method 1: Remotely log in to the active Master node as user root and run the lsof -i:38088 command. If the command output contains LISTEN, the installation is successful.

Method 2: Start a Windows ECS in the same VPC. Access port 38088 of the active Master node in the cluster. If the Superset page is displayed, the installation is successful.

OpenTSDB

OpenTSDB is a real-time monitoring information collection and display platform based on HBase. It supports second-level metric collection, uses HBase for permanent storage, capacity planning, and easy access to the existing monitoring system. OpenTSDB can obtain metrics from a large number of devices and store and index metrics as well as use the metrics to provide services, which makes the data easier to understand, for example, displaying data on the web and in graphics. For more information, visit the OpenTSDB official website at http://opentsdb.net/.

This sample script is used to automatically install OpenTSDB. Select the corresponding script path based on the region where the cluster is to be created. Enter the script path in Script Path on the Bootstrap Action page when adding a bootstrap action during cluster creation. You do not need to enter parameters for this script. Based on the OpenTSDB usage habit, you only need to run the script on the active Master node.

OpenTSDB depends on the HBase service. Therefore, you need to select HBase when creating a cluster and configure Execution Time of the bootstrap action to After component start.

After the bootstrap action is complete, use either of the following methods to verify that OpenTSDB is correctly installed.

Method 1: Remotely log in to the active Master node as user root and run the lsof -i:4242 command. If the command output contains LISTEN, the installation is successful.

Method 2: Start a Windows ECS in the same VPC. Access port 4242 of the active Master node in the cluster. If the OpenTSDB page is displayed, the installation is successful.

obsutil

obsutil is a command line tool for accessing OBS. You can use this tool to perform common configurations in OBS, such as creating buckets, uploading and downloading files/folders, and deleting files/folders. If you are familiar with command line interface (CLI), obsutil is recommended as an optimal tool for batch processing and automated tasks. For more information, see Introduction to obsutil.

This sample script is used to automatically install obsutil. Select the corresponding script path based on the region where the cluster is to be created. Enter the script path in Script Path on the Bootstrap Action page when adding a bootstrap action during cluster creation. You do not need to enter parameters for this script. In Execution Time, select After component start. In Action upon Failure, select Continue.

After execution of the bootstrap action is complete, perform the following operations to configure and verify the obsutil connectivity:

  1. Configuration methods

    You can run the following commands to initialize obsutil:

    ./opt/obsutil_linux_amd64_5.1.7.2/obsutil config-i=ak -k=sk -e=endpoint
  2. Checking the connectivity

    After the configuration is complete, you can check whether it is correct by running the following command:

    ./obsutil ls -s

    Check the configuration result based on the command output.

    • If the command output contains "Bucket number is:", the configuration is correct.
    • If the command output contains "Http status [403]", the access keys are incorrectly configured.
    • If the command output contains "A connection attempt failed", then OBS cannot be accessed. In this case, check the network condition.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel