kuma0128 / terraform-openmetadata-ecs-aurora-assets

1 stars 0 forks source link

xpack #1

Closed kuma0128 closed 2 days ago

kuma0128 commented 4 days ago

xpack.security.enabled="ture"について、ヘルスチェックを適切な権限で通す

DS-MF commented 4 days ago

https://www.elastic.co/guide/en/elasticsearch/reference/current/built-in-roles.html monitoring_user

DS-MF commented 4 days ago
bin/elasticsearch-users useradd ${var.elasticsearch_username} -p ${jsondecode(var.openmetadata_secret_version.secret_string)["elasticsearch"]} -r monitoring_user
kuma0128 commented 4 days ago
if [[ -f bin/elasticsearch-users ]]; then
  # Check for the ELASTIC_PASSWORD environment variable to set the
  # bootstrap password for Security.
  #
  # This is only required for the first node in a cluster with Security
  # enabled, but we have no way of knowing which node we are yet. We'll just
  # honor the variable if it's present.
  if [[ -n "$ELASTIC_PASSWORD" ]]; then
    [[ -f /usr/share/elasticsearch/config/elasticsearch.keystore ]] || (elasticsearch-keystore create)
    if ! (elasticsearch-keystore has-passwd --silent) ; then
      # keystore is unencrypted
      if ! (elasticsearch-keystore list | grep -q '^bootstrap.password$'); then
        (echo "$ELASTIC_PASSWORD" | elasticsearch-keystore add -x 'bootstrap.password')
      fi
    else
      # keystore requires password
      if ! (echo "$KEYSTORE_PASSWORD" \
          | elasticsearch-keystore list | grep -q '^bootstrap.password$') ; then
        COMMANDS="$(printf "%s\n%s" "$KEYSTORE_PASSWORD" "$ELASTIC_PASSWORD")"
        (echo "$COMMANDS" | elasticsearch-keystore add -x 'bootstrap.password')
      fi
    fi
  fi
fi
DS-MF commented 4 days ago

-u elastic:$ELASTIC_PASSWORD

kuma0128 commented 2 days ago

8fbdf81bbac521a4622c5b0a8bda33a1f8e94926