[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
/ ranger-docker Public archive

Get a simple dockerized ranger runtime working

Notifications You must be signed in to change notification settings

planetf1/ranger-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ranger-docker

THIS PROJECT IS NOW DEPRECATED.

Please go to http://github.com/odpi/egeria to read about Egeria, where you will also ongoing work around deployment of a

variety of components using docker build scripts, and helm charts to deploy to kubernetes

If you are interested in directly contributing this capability to Apache Ranger please feel free - and ideally get in touch so we can work on merging in the code from Egeria :-)

Nigel Jones

Docker image for standalone ranger

This project objective is to make it easy to run a simple ranger install, locally, in order to test & experiment with new plugins, or minor code enhancements.

This code is currently hosted on github at https://github.com/planetf1/ranger-docker but the hope is to integrate it into the Apache Ranger project

Update

  • MariaDB now listens externally on port 33306 to avoid clash with a locally running database

Current functionality

  • Download and build ranger itself, from git
  • Configure & launch ranger admin server
  • Solr active/running
  • No ranger plugins setup
  • little parameterization -- all hardcoded
  • No data container
NOTE: The build takes a long time (over 30 minutes)

Image Composition

  • ranger-admin - the customized ranger image, also runs solr
  • mariadb - based off mariadb on docker hub

Using the docker image

Go to the base directory of the extracted files & type
docker-compose up
Mariadb will configure & start, as will ranger including solr. The process will take around 1-2 minutes in addition to any download time.

You can then connect to Ranger as usual for example at http://mymachine:6080/

Zero to hero in six steps (Azure)

An example of how to run ranger under docker using MS Azure with very few steps -- assumes an existing Azure Account

  1. Install Docker & GIT if not already done

    Go to http://www.docker.com & install docker for Windows, Mac or Linux following the instructions

    Also install git from https://git-scm.com/download/

  2. Create an Azure container service

    Lots of possible command options, but to default to US-West & basic ubuntu server:

    docker-machine create --driver azure --azure-subscription-id aaaaaaaa-bbbb-cccc-dddd-eeeeee nigeldocker
  3. Configure the environment for the new docker machine:
    docker-machine env nigeldocker

    This will return a command to run as the last line which should be run such as

    FOR /f "tokens=*" %i IN ('docker-machine env nigeldocker') DO @%i
  4. Now get hold of the ranger docker source in git
    git clone https://github.com/planetf1/ranger-docker.git
  5. Build and run the docker images
    cd ranger-docker
    docker-compose up
  6. Checking the docker container id - needed for subsequent interaction with the container
    ibmuser@ibmvm:~$ docker ps
    CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                                                                              NAMES
    1a2ed045306c        rangerdocker_ranger-admin   "/bin/sh -c /opt/ran…"   2 hours ago         Up 2 hours          0.0.0.0:6080->6080/tcp, 0.0.0.0:6083->6083/tcp, 0.0.0.0:6182-6183->6182-6183/tcp   rangerdocker_ranger-admin_1
    2abd3e403c25        rangerdocker_mariadb        "docker-entrypoint.s…"   2 hours ago         Up 2 hours          0.0.0.0:3306->3306/tcp                                                             rangerdocker_mariadb_1
    
  7. >Deploying a ranger plugin (for resource lookup) An example:
    docker exec -it 1a2ed045306c mkdir /opt/ranger-2.0.0-SNAPSHOT-admin/ews/webapp/WEB-INF/classes/ranger-plugins/gaian
    docker cp ./ranger-gaian-plugin-1.0.0-SNAPSHOT.jar 1a2ed045306c:/opt/ranger-2.0
    .0-SNAPSHOT-admin/ews/webapp/WEB-INF/classes/ranger-plugins/gaian
    
  8. To look around the docker install for debugging etc:
    docker exec -it 1a2ed045306c /bin/bash
    
  9. Use the ranger UI

    Open up a web browser and go to http://mydockermachineip:6080/

Docker images can also be run locally, remotely, or using other cloud providers

Issues/problems

Please add any feedback in the issue tracker on github. Or if it relates to integration into ranger use RANGER-1572

Useful links

  • See the main ranger community at http://ranger.apache.org
  • Dockerize - This script can be used to synchronize between different docker containers by waiting for a particular network port to become available. See more at https://github.com/jwilder/dockerize -- this is also linked into by the official docker documentation as a best practice

Contact

Nigel Jones - jonesn@uk.ibm.com planetf1 on github.com jonesn on Apache JIRA