1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Hadoopクラスタkerberos化後のPySparkのエラー

Last updated at Posted at 2020-05-18

はじめに

HadoopクラスタのKerberos認証を有効化後にPySparkのエラーが発生しました。
その対応方法です。

環境

OS: CentOS 7.7
Hadoopディストリビューション: CDH6.2.1
master node: 3台
worker node: 6台

現象

PySparkを実行時に下記のエラー

Can't create directory
/data/1/yarn/nm/usercache/{username}/appcache/application_{id}

/data/n/yarn/nm/usercache/{username}/appcache/application_{id}
Permission denied

{username}: PySpark実行時のユーザ
{id} : SparkアプリケーションID

原因

Kerberos認証有効化前後で実行ユーザが異なるため、PySpark実行時の使用するcacheのディレクトリ権限が足りませんでした。

対応方法

woerk node全台の/data/1/yarn/nm/usercache/{username}の削除します。
Hadoopクラスタは扱うサーバ数が多いので、何かしらの構成管理ツールを使用していると思います。
構成管理ツールとして、Ansibleを使用しているので下記のplaybookを実行。

playbook
host: worker_servers
become: true
tasks:
  - name: rm -rf usercache
    file:
      path: /data/1/yarn/nm/usercache/{username}
      state: absent
# 使用しているdisk分記載
  - name: rm -rf usercache
    file:
      path: /data/n/yarn/nm/usercache/{username}
      state: absent

おわりに

Hadoopクラスタを運用するのは大変(泣)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?