@有識者各位
misskeyインスタンス構築においてwebサーバとDBサーバを分けるとき、「psqlコマンドでは問題なく入れるがmisskeyで
yarn run initするとno pg_hba.conf entry for host hogehogeって言われる際に考えられる原因ってありますか

@rustered_ML psqlコマンドではソケットで、yarn run initではlocalhostで接続しているかも。

pg_hba.confの、localで始まる行と、hostで始まる行ね。

↓のやつを試してみたら-h抜かすとたしかに入れなかったので、おそらくはそうだと思われます...
https://teratail.com/questions/301103

問題はこのDBサーバがDOのマネージドDBなんでpg_hba.confっていうかその辺りの設定変える方法が不明なんですが、ちょとtその辺りは自分で調べてみます。
ありがとうございました
:arigatougozaimasu:

フォロー

@rustered_ML -h ヌキで入れない、-h xxx.xxx.xxx.xxx だと入れるっていうことであれば、

.config/default.yml のdbにhostを指定してないとかかな?

db:
host: xxx.xxx.xxx.xxx
port: 5432

一応hostは指定してありますね。スペルミス等も無いとは思うんですが...

@rustered_ML db, user, pass もpsqlと一致していたら、つながらないとおかしいですねー。

db:
host: xxx.xxx.xxx.xxx
port: 5432

# Database name
db: misskey

# Auth
user: misskey
pass: XXXXXXXXXXXX

に対して、

psql -h xxx.xxx.xxx.xxx -p 5432 -d misskey -U misskey

という対応関係かな。

そうですね、ちゃんとその対応関係になってるのも確認してるんですが、yarnだと接続できないという状態ですね...

@rustered_ML そしたらormconfig.jsの方かな。

こんな感じになってます?

const config = require('./built/config').default;
const entities = require('./built/db/postgre').entities;

module.exports = {
type: 'postgres',
host: config.db.host,
port: config.db.port,
username: config.db.user,
password: config.db.pass,
database: config.db.db,
extra: config.db.extra,
entities: entities,
migrations: ['migration/*.ts'],
cli: {
migrationsDir: 'migration'
}
};

そうですね、確認しましたが全く同じ形になってます

const config = require('./built/config').default;
const entities = require('./built/db/postgre').entities;

module.exports = {
        type: 'postgres',
        host: config.db.host,
        port: config.db.port,
        username: config.db.user,
        password: config.db.pass,
        database: config.db.db,
        extra: config.db.extra,
        entities: entities,
        migrations: ['migration/*.ts'],
        cli: {
                migrationsDir: 'migration'
        }
};

ログインして会話に参加
Fedibird

様々な目的に使える、日本の汎用マストドンサーバーです。安定した利用環境と、多数の独自機能を提供しています。