Skip to content

Ranger Server

Koushik Ramachandra edited this page Apr 28, 2022 · 2 revisions

There is a sample ranger server included in the repository which in turn can double as the HTTP hub.

A RangerServerBundle has been introduced to act as a quick, easy-to-use, dropwizard bundle to help set up any ranger hub. The two packaged servers are zookeeper data server and http data server. An http data server could use the HTTP host and port of any other HTTP hub, making it possible to set up a tiered server, which will come in handy if you need to build a hub and spoke of servers across multiple availability zones.

Configuration

To start your own server using the RangerServerBundle atop zookeeper, assumes you have an

  • AppConfiguration - Which is the base configuration to start your app.
  • RangerConfiguration - The required ranger configuration for zookeeper to start, containing
    • namespace - The namespace against which said server needs to run.
    • zookeeper - The zookeeper connection string
    • disablePushUpdaters - If you want to have watchers enabled or otherwise
    • nodeRefreshTimeMs - The refresh time to refresh the in-memory service registry

To start your own server using the RangerServerBundle atop an HTTP hub, assumes you have an

  • AppConfiguration - Which is the base configuration to start your app.
  • RangerConfiguration - The required ranger configuration for the HTTP backend to start, containing
    • namespace - The namespace against which said server needs to run.
    • nodeRefreshTimeMs - The refresh time to refresh the in-memory service registry
    • HttpClientConfigs - A list of HTTP hubs to be used, as a backend, each config shall contain
      • host - Http host where the data repository is housed
      • port - Http port where the data repository is housed
      • secure - If the connection is on HTTPS on HTTP.
      • connectionTimeoutMs - Connection timeout in ms
      • operationTimeoutMs - Operation timeout (read/write) in ms

Usage

To initialize the zookeeper bundle to your dropwizard application

bootstrap.addBundle(new ZKServerBundle<AppConfiguration>() {
            @Override
            protected RangerConfiguration getRangerConfiguration(AppConfiguration configuration) {
                return configuration.getRangerConfiguration();
            }
        });

To initialize the HTTP server bundle to your dropwizard application

bootstrap.addBundle(new HttpServerBundle<AppConfiguration>() {
            @Override
            protected RangerConfiguration getRangerConfiguration(AppConfiguration configuration) {
                return configuration.getRangerConfiguration();
            }
        });

Resources

Assuming you have the server running on test.ranger.com, you will have the following resources available

  • GET /ranger/v1/services - Gets the list of services from the repository (using the internal registry)
  • GET /ranger/nodes/v1/{namespace}/{serviceName} - Gets the nodes available at the given namespace and service name from across all the hubs specified, if you are going to provide the list of hubs in the HTTP client.
Clone this wiki locally