Bash Scripts for Automated Tasks
Here is a collection of Bash scripts designed to streamline and automate essential tasks in your ODP environment. Each script is linked for quick access and use. Follow the provided instructions and customize the scripts with the specific details of your environment as needed.
- Setup SSL on ODP Environment
- Setup Ambari SSL
- Setup Knox SSL
- Setup Ambari LDAP
- Setup Ranger LDAP
- Ambari Services Configuration and Restoration
Setup SSL on ODP Environment via Bash
To view the script, click here.
This Bash script automates the setup of SSL for a variety of services, including HDFS, YARN, MapReduce, Infra-Solr, Hive, Ranger, Kafka, HBase, Spark2, Spark3, and Oozie. The script must be executed on the Ambari Server node.
To make use of this script for enabling SSL in your ODP environment, perform the following steps:
Execute the script on the Ambari Server node.
Modify the script to include the following details:
USER: Ambari Admin user
PASSWORD: Ambari Admin user password
PORT: Ambari Server port
PROTOCOL: Choose between 'http' or 'https' based on whether Ambari has SSL enabled.
keystore: Ensure the keystore file is available on all nodes.
keystorepassword: Provide the keystore password.
truststore: Ensure the truststore file is available on all nodes.
truststorepassword: Provide the truststore password.
For Infra-Solr: You will need a PKCS12 format keystore and truststore.
- keystore_p12: Ensure the PKCS12 format keystore file is present on the Infra-Solr node.
- truststore_p12: Verify that the PKCS12 format truststore file is present on the Infra-Solr node.

Setup Ambari SSL
To view the script, click here.
Modify the above script to include the following details:
- IMPORT_CERT_PATH: Ambari Server Certificate file
- IMPORT_KEY_PATH: Ambari Server Certificate private key
- PEM_PASSWORD: Ambari Server Certificate private key password

Setup Knox SSL
To view the script, click here.
- This script can be used to replace the default KNOX self-signed certificate with the provided CA-signed certificate.
- Download and execute the script on the Knox Server node.
- Verify that the keystore password matches the master secret key you created earlier. The script includes an option to reset it if necessary.
Setup Ambari LDAP
To view the script, click here.
- Update the script with the correct LDAP/AD details before running it.
- After executing the script, restart the Ambari Server and sync the LDAP user.
Setup Ranger LDAP
To view the script, click here.
- Before running the script, ensure to adjust it with the accurate LDAP/AD details.

Ambari Services Configuration and Restoration
To view the script, click here.
This script allows you to back up and restore configurations for various services managed by Ambari, including Hue, Impala, Kafka, Ranger, Ranger KMS, Spark3, and NiFi. It supports both SSL and non-SSL Ambari configurations and offers options for individual service or all-service backup and restore.
Variables to Modify
- AMBARISERVER: The fully qualified domain name of the Ambari server.
- USER: The username for Ambari authentication.
- PASSWORD: The password for Ambari authentication.
- PORT: The port number on which Ambari is running (8080 for HTTP, 8443 for HTTPS).
- PROTOCOL: The protocol used for Ambari server communication (http or https).
How to Use It
- Set Variables: Ensure that you have set the variables
AMBARISERVER
,USER
,PASSWORD
,PORT
, andPROTOCOL
correctly at the beginning of the script. - Run the Script: Execute the script using the following command:
./config_backup_restore.sh
- Choose Action: The script will prompt you to choose whether you want to back up or restore configurations.
- Select Service: Depending on your choice, you will be asked to select the service for which you want to perform the action. You can also choose the "All" option to perform the action on all supported services.
