Preparing the Bootstrap Action Script for an MRS Node
Currently, bootstrap actions support Linux shell scripts only. Script files must end with .sh.
Follow these steps to prepare the bootstrap action script for the MRS node:
- Upload the required installation packages to the OBS file system.
Before compiling a script, you need to upload all required installation packages, configuration packages, and relevant files to the OBS file system in the same region.
Different regions are isolated from each other. Therefore, MRS VMs cannot download OBS files from other regions.
- Use a script for downloading files from the OBS file system.
You can specify the file to be downloaded from OBS in the script. To upload a file to a private file system, you need to use hadoop fs to download the file.
To download the myfile.tar.gz file from the obs://yourbucket/ directory to your local host and decompress it to the /your-dir directory, run the following commands:
source /opt/Bigdata/client/bigdata_env;hadoop fs -D fs.obs.endpoint=<obs-endpoint> -D fs.obs.access.key=<your-ak> -D fs.obs.secret.key=<your-sk> -copyToLocal obs://yourbucket/myfile.tar.gz ./
mkdir -p /<your-dir>
tar -zxvf myfile.tar.gz -C /<your-dir>
- /opt/Bigdata/client indicates the client path. Change it based on the site requirements.
- The Hadoop client has been preinstalled on the MRS node. You can run the hadoop fs command to download or upload data from or to OBS.
- Obtain the obs-endpoint of each region. For details, see Regions and Endpoints.
- Commands carrying authentication passwords pose security risks. Disable historical command recording before running such commands to prevent information leakage.
- Upload the script to the OBS file system.
After script compilation, upload the script to the OBS file system in the same region. At the time you specify, each node in the cluster downloads the script from OBS and executes it as user root.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot