RANGER-5680: Make Solr optional in docker so Ranger can run without it - #1058
RANGER-5680: Make Solr optional in docker so Ranger can run without it#1058paras200 wants to merge 1 commit into
Conversation
|
@paras200 |
|
Thanks @ramackri this is a draft PR, will review once I am marking it ready. |
1229d50 to
3393f80
Compare
987a176 to
ccc8ffb
Compare
|
LGTM |
|
Thanks @paras200 for the patch. Few questions:
Thanks CC: @mneethiraj |
c7e3364 to
0be020b
Compare
|
Thanks @kumaab for the review! |
|
|
||
| # 1. Start OpenSearch first (Ranger Admin's bootstrapper needs it on startup) | ||
| docker compose -f docker-compose.ranger.yml -f docker-compose.ranger-opensearch.yml \ | ||
| -f docker-compose.ranger-kafka.yml -f docker-compose.ranger-hadoop.yml \ |
There was a problem hiding this comment.
I'm trying to understand why do we need hadoop container here? Opensearch requires kafka and audit server only right ?
| # For Solr: export RANGER_AUDIT_STORE=solr and replace -f docker-compose.ranger-opensearch.yml with -f docker-compose.ranger-solr.yml below. | ||
|
|
||
| docker compose -f docker-compose.ranger.yml -f docker-compose.ranger-solr.yml -f docker-compose.ranger-usersync.yml -f docker-compose.ranger-tagsync.yml -f docker-compose.ranger-pdp.yml -f docker-compose.ranger-kms.yml up -d | ||
| docker compose -f docker-compose.ranger.yml -f docker-compose.ranger-opensearch.yml -f docker-compose.ranger-usersync.yml -f docker-compose.ranger-tagsync.yml -f docker-compose.ranger-pdp.yml -f docker-compose.ranger-kms.yml up -d |
There was a problem hiding this comment.
ranger-opensearch ==> ranger-${RANGER_AUDIT_STORE}
Please update other references as well.
|
|
||
| For **existing Solr-based installs**, switch stores by setting `audit_store=opensearch` (and the | ||
| `audit_opensearch_*` properties) in install.properties and restarting Ranger Admin. | ||
| For **existing Solr-based installs**, set `RANGER_AUDIT_STORE=opensearch`, recreate the Ranger |
There was a problem hiding this comment.
typo: RANGER_AUDIT_STORE=opensearch ==> RANGER_AUDIT_STORE=solr
There was a problem hiding this comment.
this paragraph is to describe migration to OpenSearch for existing Solr-based installs (set RANGER_AUDIT_STORE=opensearch). Re wrote this sentence to make it clearer.
| docker compose -f docker-compose.ranger.yml -f docker-compose.ranger-opensearch.yml up -d | ||
| ~~~ | ||
|
|
||
| #### OpenSearch audit flow (replace Solr for access audits) |
There was a problem hiding this comment.
Suggestion: (replace Solr for access audits) may be removed.
| - ./scripts/ozone/docker-config | ||
| # Do not pass KERBEROS_ENABLED: Ozone libexec/entrypoint.sh waits for krb5:8081. | ||
| command: bash -c "unset KERBEROS_ENABLED; source /opt/hadoop/ranger-ozone-plugin/ranger-ozone-setup.sh && (test -f /data/metadata/om/current/VERSION || /opt/hadoop/bin/ozone om --init) && exec /opt/hadoop/bin/ozone om" | ||
| command: bash -c "until [ -f /etc/keytabs/.provisioned ]; do echo 'waiting for keytabs...'; sleep 3; done && unset KERBEROS_ENABLED; source /opt/hadoop/ranger-ozone-plugin/ranger-ozone-setup.sh && (test -f /data/metadata/om/current/VERSION || /opt/hadoop/bin/ozone om --init) && exec /opt/hadoop/bin/ozone om" |
There was a problem hiding this comment.
Tried bringing this container in local setup. This change is causing the om container to print waiting for keytabs..., reverting this change causes the container to proceed further. please check.
0b15436 to
f8271fd
Compare
…e in docker - Introduce RANGER_AUDIT_STORE env-var (opensearch | solr; default: opensearch) so the docker stack can switch audit backends without editing install.properties - Switch docker-compose.ranger-opensearch.yml to use the official opensearchproject/opensearch image directly (version 3.7.0); remove the custom Dockerfile.ranger-opensearch and its associated setup scripts - Update all four ranger-admin-install-*.properties files to activate the opensearch audit block by default (audit_store=opensearch) while keeping the solr block available via RANGER_AUDIT_STORE=solr - Add AuditOpenSearchDispatcher and dispatcher-common unit tests; replace sun.misc.Unsafe constructor bypass with package-private test constructors - Fix docker-compose.ranger-ozone.yml: replace broken .provisioned sentinel wait loop with ozone-service-start.sh for all three Ozone services (datanode, scm, om), add om volume mount and restart: on-failure:3 - Update CI workflow to smoke-test the OpenSearch audit stack instead of Solr - Update README with OpenSearch audit flow documentation
| @@ -163,7 +162,7 @@ else | |||
| extractOzoneIfNeeded | |||
| elif [[ $arg == 'opensearch' ]] | |||
There was a problem hiding this comment.
Let's remove this if condition, for opensearch - download-archives.sh is not applicable.
| ~~~ | ||
| chmod +x download-archives.sh | ||
| # use a subset of the below to download specific services | ||
| ./download-archives.sh hadoop hive hbase kafka knox ozone opensearch |
There was a problem hiding this comment.
opensearch should be removed here.
| ~~~ | ||
| #### Bring up ozone containers | ||
|
|
||
| ##### Ozone action-matcher feature flag |
There was a problem hiding this comment.
This section is not really relevant here, could you please help this move out to a different readme in the same directory, may be something like OZONE-ACTION-MATCHER.md, ref: 37b6e02#diff-da6584afb9b693c71ad5427c1a5e1e0720e306e0fbfb664f9fb79c7ce44c29fa
| Set `RANGER_AUDIT_STORE=opensearch` — no manual `install.properties` edits needed. | ||
|
|
||
| ~~~ | ||
| # Prerequisites: build Ranger artifacts (admin, audit ingestor/dispatcher, ...) and download archives |
There was a problem hiding this comment.
L178-182 can be skipped, they are already covered earlier in the setup process.
What changes were proposed in this pull request?
RANGER-5680 introduces a RANGER_AUDIT_STORE environment variable that selects the audit backend without requiring manual edits to install.properties, mirroring the existing RANGER_DB_TYPE pattern for database selection.
Audit store selection
export RANGER_AUDIT_STORE=opensearch # default — no change needed
export RANGER_AUDIT_STORE=solr # opt-in to Solr
ranger.sh rewrites the active audit block in install.properties at container startup based on RANGER_AUDIT_STORE, so setup.sh picks up the correct configuration. OpenSearch is now the default; Solr remains fully supported via the env-var.
Changes
How was this patch tested?