19. Sentry. Установка и настройка

В этой части описывается настройка Sentry.

Добавление сервиса Sentry

  1. В консоли Cloudera Manager в меню выбираем ‘Add Service’:
  2. Выбираем Sentry.
  3. Распределяем роли:
  4. Настройка базы данных. Так как сейчас используется встроенная база данных, то никаких дополнительных действий не производим, а нажимаем кнопку ‘Test Connection’.
  5. Наблюдаем запуск ролей.
  6. Визард успешно закончен.

Перенастройка размещения log’ов

  1. В настройках Sentry, используя категорию ‘Logs’, изменяем следующие параметры, добавляя ‘/data’ вместо ‘/var’:
PropertyValueDescription
Sentry Server Log Directory /data/log/sentry Directory where Sentry Server will place its log files.
  1. Нажимаем Save Changes.

Создание группы администраторов Sentry

  1. Добавление группы во FreeIPA. Так как установка кластера производится с машины, домен которой отличен от домена настраиваемых машин, то вновь используем ansible:

    $ ADM_USER='eugene' \
    ADM_PASS='JL9d]qtw$p=2=M2K=~z?|EU,1' \
    CL_NAME="TEST1"          # UPPERCASE \
    CL_NAME_L=${CL_NAME,,}   # lowercase
    
    $ ansible mgm -i cluster.inv -m shell -a "echo '${ADM_PASS}' | kinit ${ADM_USER} && \
      ipa group-add --desc='Sentry admins for cluster ${CL_NAME}' ${CL_NAME_L}_sentry_admins"
    
    10.15.120.140 | CHANGED | rc=0 >>
    Password for [email protected]:
    ---------------------------------
    Added group "test1_sentry_admins"
    ---------------------------------
      Group name: test1_sentry_admins
      Description: Sentry admins for cluster TEST1
      GID: 1262100013
    
  2. В настройках службы Sentry изменяем следующие параметры:

PropertyValueDescription
Admin Groups
sentry.service.admin.group
Добавляем созданную ранее группу:
test1_sentry_admins
If an end user is in one of these admin groups, that user has administrative privileges on the Sentry Server.
Allowed Connecting Users
sentry.service.allow.connect
nifantevea
user_da

Сюда добавляем УЗ (обязательно являющиеся участниками группы 'test1_sentry_admins'), из-под которых будет производиться администрирование Sentry с помощью CLI.
List of users allowed to connect to the Sentry Server. These are usually service users such as hive and impala, and the list does not usually need to include end users.
  1. Нажимаем Save Changes.

Настройка других сервисов для работы с Sentry

Hive

PropertyValueDescription
Enable Stored Notifications in Database Enable stored notifications of metadata changes. When enabled, each metadata change will be stored in NOTIFICATION_LOG.
HiveServer2 Enable Impersonation
hive.server2.enable.doAs
HiveServer2 will impersonate the beeline client user when talking to other services such as MapReduce and HDFS.
Sentry Service ◉ Sentry ○ None Name of the Sentry service that this Hive service instance depends on. If selected, Hive uses this Sentry service to look up authorization privileges. Before enabling Sentry, read the requirements and configuration steps in Setting Up The Sentry Service.
  1. Нажимаем Save Changes.

HDFS

  1. В настройках HDFS изменяем следующие параметры:
PropertyValueDescription
Sentry Service ◉ Sentry
○ None
Name of the Sentry service that this Hue service instance depends on
  1. Нажимаем Save Changes.
  2. Перезапускаем все зависимые сервисы по приглашению Cloudera Manager Console.

“Отключение доступа внешних приложений к Hive Metastore” описал на странице “18. Hive. Установка и настройка”.