0
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.

bitnami/postgresqlから作成したインスタンスでpostgresユーザのパスワードが設定されない問題の解決法

Posted at

問題

BitnamiのPostgreSQLのHelm Chartを使ってStatefulSetを構築していたが、デフォルト管理者のpostgresユーザにパスワードが設定されず

User "postgres" has no password assigned.

のエラーが出てしまいログインできない。

解決方法

POSTGRES_PASSWORDなどの変数を設定してもダメでした・・・。以下の手順でパスワードを設定されるまでに至ったので共有します。

1. プロセスのユーザをpostgresに切り替える

/opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash

2. DBの初期化

initdb -D /bitnami/postgresql/databak/

3. 既存データを初期化済みのもので入れ換える

rm -rf /bitnami/postgresql/data
mv /bitnami/postgresql/databak /bitnami/postgresql/data

4. StatefulSetを再起動する

ここまで行って再起動後のログを確認すると、

Changing password of postgres

というメッセージが出てパスワードが設定されたことがわかります🎉

参考

0
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
0
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?