Kerberos は、セキュリティで保護されていないネットワークを介して通信するノードが自分の身元を安全に証明するためのネットワーク認証プロトコルです。 E-MapReduce 2.7.x および 3.5.x 以降のバージョンでは、 Kerberos セキュリティモードで起動されるオープンソースコンポーネントにおける、クラスターの作成がサポートされています。 このモードでは、認証されたクライアントのみが HDFS などのクラスターサービスにアクセスします。

前提条件

E-MapReduce の最新バージョンによってサポートされている Kerberos コンポーネントは、以下の表のとおりです。
コンポーネント名 コンポーネントのバージョン
YARN 2.7.2
Spark 2.1.1/1.6.3
Hive 2.0.1
Tez 0.8.4
ZooKeeper 3.4.6
Hue 3.12.0
Zeppelin 0.7.1
Oozie 4.2.0
Sqoop 1.4.6
HBase 1.1.1
Phoenix 4.7.0
Kafka、Presto、および Storm では現在 Kerberos はサポートされていません。

セキュリティクラスターの作成

以下の図のように 、クラスター作成ページのソフトウェア設定タブで [高セキュリティモード] トグルボタンをオンにします。

セキュリティクラスターの作成

Kerberos 認証

Kerberos は対象鍵暗号化に基づいた ID 認証プロトコルです。 サードパーティーの認証サービスとして、Kerberos は他のサービスに認証機能を提供します。 SSO もサポートされており、クライアントは認証後に HBase および HDFS などのさまざまなサービスにアクセスします。

Kerberos プロトコルプロセスは主に 2 段階に分けられます。第 1 段階は KDC によるクライアント ID の認証で、第 2 段階はサービスによるクライアント ID の認証です。

Kerberos 認証
  • KDC

    Kerberos サーバー

  • クライアント

    ユーザー (プリンシパル) がサービスにアクセスする必要がある場合は、KDC とサービスでプリンシパルの ID を認証します。

  • サービス

    Kerberos と統合されているサービスには、HDFS、YARN、および HBase があります。

  • KDC ID 認証

    プリンシパルは Kerberos に統合されたサービスにアクセスする前に、まず KDC ID 認証を通る必要があります。

    認証後、クライアントは Kerberos に統合されたサービスへのアクセスに使用する TGT (ticket-granting ticket) を受信します。

  • サービス ID 認証

    プリンシパルが TGT を受信すると、サービスにアクセスできるようになります。 TGT およびアクセスするサービス名 (HDFS など) を使用して KDC から SGS (service-granting ticket) を取得し、SGS を使用してサービスにアクセスします。 これによって関連情報を使用してクライアントで ID を認証します。 認証後、クライアントは正常にサービスにアクセスします。

Kerberos と E-MapReduce

クラスターの作成時に、E-MapReduce Kerberos セキュリティクラスター内のサービスは Kerberos セキュリティモードで起動されます。

  • Kerberos サーバーは HasServer
    • Alibaba Cloud E-MapReduce コンソールにログインし、[クラスター] > > [設定管理] > [HAS] の順に選択して、表示、設定の変更、および再起動などの操作を実行します。
    • 非 HA クラスターはemr-header-1 ノードにデプロイされますが、一方 HA クラスターは emr-header-1 ノードと emr-header-2 ノードの両方にデプロイされます。
  • 4 つの ID 認証方法をサポート

    HasServer では以下の 4 つの ID 認証方法がサポートされています。 クライアントは、関連パラメーターを設定することで、HasServer によって使用される方法を指定します。

    • MIT Kerberos と互換性のある ID 認証

      クライアント設定

      If you want to execute a client request on a cluster node, you must set
      hadoop.security.authentication.use.has in /etc/ecm/hadoop-conf/core-site.xml to false.
      In case of any jobs are running through the execution plan of the console, then values in the /etc/ecm/hadoop-conf/core-site.xml file on the master node must not be modified. Otherwise, the job in the execution plan fails because of the authentication failure. You can follow these steps:
      export HADOOP_CONF_DIR=/etc/has/hadoop-conf Export a temporary environment variable. The hadoop.security.authentication.use.has value under this path has already been set to false.

      アクセス方法については、オープンソースクライアントを使用して、HDFS クライアントなどのサービスにアクセスします。 詳細については、こちらをクリックします

    • RAM ID 認証

      クライアント設定

      If you want to run a client request on a cluster node, you must set
      hadoop.security.authentication.use.has in /etc/ecm/hadoop-conf/core-site.xml to true, and auth_type in /etc/has/has-client.conf to RAM.
      In case of any jobs are running through the execution plan of the console, then values in the /etc/ecm/hadoop-conf/core-site.xml and /etc/has/has-client.conf files on the master node must not be modified. Otherwise, the job in the execution plan fails because of the authentication failure. You can use the following method:
      export HADOOP_CONF_DIR=/etc/has/hadoop-conf; export HAS_CONF_DIR=/path/to/has-client.conf Export a temporary environment variable, and then set the auth_type in the has-client.conf file of the HAS_CONF_DIR folder to RAM.

      アクセス方法については、クライアントは Hadoop または HBase などのクラスターのソフトウェアパッケージを使用します。 詳細については、こちらをクリックします

    • LDAP ID 認証

      クライアント設定

      If you want to execute a client request on a cluster node, you must set
      hadoop.security.authentication.use.has in /etc/ecm/hadoop-conf/core-site.xml to true, and auth_type in /etc/has/has-client.conf to LDAP.
      In case of any jobs are running through the execution plan of the console, then values in the /etc/ecm/hadoop-conf/core-site.xml and /etc/has/has-client.conf files on the master node must not be modified. Otherwise, the job in the execution plan fails because of the authentication failure. You can follow these steps:
      export HADOOP_CONF_DIR=/etc/has/hadoop-conf; export HAS_CONF_DIR=/path/to/has-client.conf Export temporary environment viarables, and then set the auth_type in the has-client.conf file of the HAS_CONF_DIR folder to LDAP.

      アクセス方法については、クライアントは Hadoop または HBase などのクラスターのソフトウェアパッケージを使用します。 詳細については、こちらをクリックします

    • 実行計画認証

      E-MapReduce コンソールの実行計画を介してジョブを送信する場合は、emr-header-1 ノードのデフォルト設定を変更する必要はありません。

      クライアント設定

      Set hadoop.security.authentication.use.has in /etc/ecm/hadoop-conf/core-site.xml to true, and auth_type in /etc/has/has-client.conf on emr-header-1 to EMR.

      詳細については、こちらをクリックします

  • その他

    クラスターにアクセスするためのマスターノードへのログイン

    管理者は Has アカウント (デフォルトのログイン方法は MIT Kerberos と互換性があります) を使用してマスターノードにログインし、クラスターサービスにアクセスします。 これによって、トラブルシューティングや運用タスクを実行します。

    >sudo su has
    >hadoop fs -ls /
    前述のアカウントがすでに Kerberos 認証を通っているなら、認証が通っているその他のアカウントでもマスターノードへのログインが可能です。 さらに、マスターノードで MIT Kerberos と互換性がある認証方法を使用する必要がある場合は、まずこのアカウントで環境変数をエクスポートする必要があります。
    export HADOOP_CONF_DIR=/etc/has/hadoop-conf/