ローカルKDCおよびActive Directory KDCを使用したKerberos認証の構成

ビッグ・データ・サービス・クラスタは、デフォルトでローカルMIT KDCをプロビジョニングします。Active Directoryドメインに属するユーザーに Active Directory KDCを使用するようにクラスタをプロビジョニングすることもできます。また、2つのレルム間に相互信頼を設定する必要もあります。

Active Directory KDCを使用するためのAmbariの更新

  1. Apache Ambariにアクセスします。
  2. サイド・ツールバーの「クラスタ管理者」で、「Kerberos」を選択します。
  3. 「Configs」タブを選択し、「Advanced krb5-conf」セクションを展開します。
  4. 次の内容のように「krb5-conf template」フィールドを変更します:
    {#
    # Licensed to the Apache Software Foundation (ASF) under one
    # or more contributor license agreements.  See the NOTICE file
    # distributed with this work for additional information
    # regarding copyright ownership.  The ASF licenses this file
    # to you under the Apache License, Version 2.0 (the
    # "License"); you may not use this file except in compliance
    # with the License.  You may obtain a copy of the License at
    #
    #   http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    #}
    [libdefaults]
      renew_lifetime = 7d
      forwardable = true
      default_realm = {{realm}}
      ticket_lifetime = 24h
      dns_lookup_realm = false
      dns_lookup_kdc = false
      #default_ccache_name = /tmp/krb5cc_%{uid}
      #default_tgs_enctypes = {{encryption_types}}
      #default_tkt_enctypes = {{encryption_types}}
    {% if domains %}
    [domain_realm]
    {%- for domain in domains.split(',') %}
      {{domain|trim()}} = {{realm}}
    {%- endfor %}
    {% endif %}
      example.oraclevcn.com = <ad-realm>
     
    [logging]
      default = FILE:/var/log/krb5kdc.log
      admin_server = FILE:/var/log/kadmind.log
      kdc = FILE:/var/log/krb5kdc.log
     
    [realms]
      {{realm}} = {
    {%- if master_kdc %}
        master_kdc = {{master_kdc|trim()}}
    {%- endif -%}
    {%- if kdc_hosts > 0 -%}
    {%- set kdc_host_list = kdc_hosts.split(',')  -%}
    {%- if kdc_host_list and kdc_host_list|length > 0 %}
        admin_server = {{admin_server_host|default(kdc_host_list[0]|trim(), True)}}
    {%- if kdc_host_list -%}
    {%- if master_kdc and (master_kdc not in kdc_host_list) %}
        kdc = {{master_kdc|trim()}}
    {%- endif -%}
    {% for kdc_host in kdc_host_list %}
        kdc = {{kdc_host|trim()}}
    {%- endfor -%}
    {% endif %}
    {%- endif %}
    {%- endif %}
      }
     
    {# Append additional realm declarations below #}
      <ad-realm> = {
        admin_server = server-example.oraclevcn.com:749
        kdc = kdc-example.oraclevcn.com:88
        default_domain = domain-example.oraclevcn.com
      }
     
    [capaths]
    <ad-realm> = {
    <your-local-realm> = .
    }
  5. 構成を保存し、影響を受けるすべてのサービスを再起動します。
  6. 「HDFS」「Configs」「Advanced」「Advanced core-site」に移動します。
  7. hadoop.security.auth_to_localパラメータを次のように変更します:
    RULE:[1:$1@$0](.*@<ad-realm>)s/@.*//

    例:

    RULE:[2:$1@$0](yarn@EXAMPLE.ORACLE.COM)s/.*/yarn/
    RULE:[2:$1@$0](yarn-ats-hbase@EXAMPLE.ORACLE.COM)s/.*/yarn-ats/
    RULE:[1:$1@$0](.*@EXAMPLE.REALM)s/@.*//
    DEFAULT