How to Build and Deploy Apache Ranger Using Docker

Jul 3, 2023 | Programming

Apache Ranger is a powerful tool that provides comprehensive security for Hadoop ecosystems. This blog will guide you through the steps to build and deploy Apache Ranger using Docker, allowing you to efficiently manage data security policies.

Building Ranger in Docker

Using Docker to build and run Apache Ranger simplifies the installation process. Follow the steps below:

  1. Check out the code from the GIT repository.
  2. Ensure that Docker and Docker Compose are installed and running on your system.
  3. Ensure that JDK 1.8+ is installed on your system.
  4. Ensure that Apache Maven is installed on your system.
  5. Run the command to build and run Ranger from Docker:
  6. .ranger_in_docker up
  7. After successful completion, access the Ranger Admin Console by navigating to: http://hostname-of-system:6080
    UserName: admin
    Password: rangerR0cks!

Regular Build Process

If you prefer a regular build process, follow these steps:

  1. Check out the code from the GIT repository.
  2. On the root folder, execute the following Maven commands:
  3. mvn clean compile package install
    mvn eclipse:eclipse
  4. Ranger Admin UI tests depend on PhantomJS. If you encounter build failures with npm or Karma errors, you have two options:
    • Install PhantomJS dependencies for your platform (bzip2 and fontconfig).
    • Skip JavaScript test execution:
      mvn -DskipJSTests ...
  5. After the build commands, expect to see various TAR files in the target folder:
ranger-version-admin.tar.gz
ranger-version-atlas-plugin.tar.gz
ranger-version-hbase-plugin.tar.gz
... (and other plugins)

Importing Apache Ranger Project into Eclipse

  1. Create an Eclipse workspace called ranger.
  2. Import Maven project from the root directory where the Ranger source code is downloaded and built.

Deployment Process

To deploy Apache Ranger, follow the installation process outlined below:

Installation Host Information

Ensure the following components are correctly installed on their designated hosts:

  • Ranger Admin Tool Component: Install ranger-version-number-admin.tar.gz on a host running Policy Admin Tool web application on port 6080.
  • Ranger User Synchronization Component: Install ranger-version-number-usersync.tar.gz to synchronize external user group information into Ranger database.
  • Ranger Plugin Components: Install respective plugins on the corresponding hosts (e.g., HDFS Plugin on Name Node hosts).

Installation Process

  1. Download the TAR.GZ file into a temporary folder on the target box.
  2. Expand the TAR.GZ file into the /usr/lib/ranger folder.
  3. Navigate to the component name under the expanded folder (e.g., /usr/lib/ranger/ranger-version-number-admin).
  4. Modify the install.properties file with appropriate variable values.
  5. Execute the setup commands as follows:
    • If the module has setup.sh, execute .setup.sh.
    • If the install.sh file does not exist, execute .enable-component-plugin.sh.

Troubleshooting Tips

If you encounter issues during the setup, consider the following troubleshooting ideas:

  • Ensure all prerequisites (Docker, JDK, Maven) are correctly installed and configured.
  • Verify that the firewall allows traffic on port 6080 for accessing Ranger Admin Console.
  • Check Docker logs for any errors while building the container.
  • For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox