Linux-UNIX: Guardium と Ranger の通信の構成
Guardium システムと Ranger の間で通信を確立する方法について説明します。
始める前に
- SSL を使用している場合は、CLI コマンド store certificate keystore trusted console を使用して、証明書を鍵ストアに追加します。
手順
- 「設定」 > 「ツールとビュー」 > 「Hadoop モニター」に移動します。
-
「クラスター情報の追加」セクションで
をクリックして、新しい構成の定義を開始します。
- 「名前」フィールドに、構成の名前を入力します。
- 「Hadoop ディストリビューション」メニューから Hortonworks を選択します。
- 「ホスト名/IP」フィールドに、Ambari サーバーのホスト名または IP アドレスを入力します。
- 「ポート番号」フィールドに、Ambari サーバーのポート番号を入力します。
このフィールドを空白のままにすると、構成ではデフォルト・ポートの 8080 が使用されます。
- 「クラスター名」フィールドに、Hadoop クラスターの名前を入力します。
- SSL を使用している場合は、「SSL の有効化」チェック・ボックスにチェック・マークを付けます。
- 「ユーザー名」フィールドに、Ambari 管理者のユーザー名を入力します。
- 「パスワード」フィールドに、Ambari 管理者アカウントのパスワードを入力します。
- 「接続のテスト」をクリックして、構成を検証します。
- 「保存」をクリックして構成を保存します。
- Hive 3+ を使用している場合: Hadoop 管理者は構成を変更する必要があります。
- Hive 用の Ambari の拡張構成ページで、Guardium ロガー/アペンダーへの以前の参照を、log4j 2 構成ファイル (例えば、beeline-log4j2 ファイル、hive-exec-log4j2 ファイル、hive-log4j2 ファイル、および llap-cli-log4j2 ファイル) から削除します。以下の行を削除します。
# Configuration for Guardium integration with Ranger log4j logging. log4j.appender.guardlistener=org.apache.log4j.net.SocketAppender log4j.appender.guardlistener.Port=5555 log4j.appender.guardlistener.RemoteHost=hw-cl4-01.guard.swg.usma.ibm.com log4j.logger.xaaudit=ALL,guardlistener
- 以下の行を log4j 2 構成ファイルに追加します。
# audit logger # Configuration for Guardium integration with Ranger log4j logging. appender.guardlistener.type=Socket appender.guardlistener.name=guardlistener appender.guardlistener.port=5555 appender.guardlistener.host=9.32.164.237 appender.guardlistener.layout.type = SerializedLayout logger.xaaudit.name=xaaudit logger.xaaudit.level=INFO logger.xaaudit.appenderRef.guardlistener.ref = guardlistener
- ご使用の環境に合わせてポートとホストを調整します。ホストは使用している S-TAP®、ポートは変更されない限り 5555 です。変更する場合は、guard_tap.ini ファイルの log4j_port パラメーター値と一致させる必要があります。
- 4 つのセクション (beeline-log4j2、hive-exec-log4j2、hive-log4j2、および llap-cli-log4j2) で同じ変更を行って、log4j 2 構成ファイルを変更します。変更は以下のとおりです。
- guardlistener をアペンダーのリストに追加します。
appenders = console, DRFA, audittest, guardlistener
- xaaudit をロガーのリストに追加します。
NIOServerCnxn, ClientCnxnSocketNIO, DataNucleus, Datastore, JPOXgua, xaaudit
- guardlistener をアペンダーのリストに追加します。
- HIVE サービスを再始動します。
- Hive 用の Ambari の拡張構成ページで、Guardium ロガー/アペンダーへの以前の参照を、log4j 2 構成ファイル (例えば、beeline-log4j2 ファイル、hive-exec-log4j2 ファイル、hive-log4j2 ファイル、および llap-cli-log4j2 ファイル) から削除します。以下の行を削除します。
- Hive 3+ より前の Hive を使用している場合: Hadoop 管理者は構成を検証する必要があります。
-
# Configuration for Guardium integration with Ranger log4j logging. log4j.appender.guardlistener=org.apache.log4j.net.SocketAppender log4j.appender.guardlistener.Port=5555 log4j.appender.guardlistener.RemoteHost=<host name> log4j.logger.xaaudit=ALL,guardlistener
- ご使用の環境に合わせてポートとホストを調整します。ホストは使用している S-TAP、ポートは変更されない限り 5555 です。変更する場合は、guard_tap.ini ファイルの log4j_port パラメーター値と一致させる必要があります。
custom ranger-<service>-audit
の以下の設定を確認してください。xasecure.audit.destination.log4j=true xasecure.audit.destination.log4j.logger=xaaudit
- 変更を加えた場合は、HIVE サービスを再始動します。
-
- Solr を使用している場合:
-
/usr/local/guardium/guard_stap/guard_log4j_listener_config.py スクリプトを使用してモニターできるように Solr を登録します。ご使用のホスト名に置き換えて、次のコマンドを入力します。
./guard_log4j_listener_config.py -a <hostname> -b 8444 -u admin -p admin -c hw3cl1 -s solr -l 5555 -x enable --ssl
- Ranger プラグインをインストールし、以下の行をこれらのファイルに追加して log4j ロギングを有効にします。
- /usr/cloudera-hdp-solr/xxx/cloudera-hdp-solr/solr/server/solr-webapp/webapp/WEB-INF/lib/ranger-solr-audit.xml
- /usr/cloudera-hdp-solr/xxx/cloudera-hdp-solr/solr/server/resources/ranger-solr-audit.xml
<!-- Log4j audit provider configuration --> <property> <name>xasecure.audit.destination.log4j</name> <value>true</value> </property> <property> <name>xasecure.audit.destination.log4j.logger</name> <value>xaaudit</value> </property> <property> <name>xasecure.audit.log4j.is.enabled</name> <value>true</value> </property>
- Solr を再始動します。
-