如何在gitlab omnibus docker容器中或从远程终端访问/登录postgres? [英] How to access/login postgres in gitlab omnibus docker container or from remote terminal?

查看:220
本文介绍了如何在gitlab omnibus docker容器中或从远程终端访问/登录postgres?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Gitlab的 Omnibus 版本使用 postgresql ['enable'] = true ,这似乎无法访问postgresql通过普通的 psql 命令,即使在Omnibus Gitlab容器本身中也是如此。

The Omnibus version of Gitlab by default are using postgresql['enable'] = true, this seems that the postgresql can not be accessed by normal psql command, even in the Omnibus Gitlab container itself.

这是真的吗?如果没有,我该如何从远程终端访问此嵌入式postgresql?

So is this true? If not how can I access this embedded postgresql from remote terminal?

这个问题确实是我想做的事,它与我的另一篇帖子有关 Gitlab Omibus版本安装的postgreSQL的默认密码是什么?

This question is really what I want to do and it relates to my another post What's the default password for postgreSQL installed by Gitlab Omibus version?

推荐答案

如官方文档中所述,但不是具体而明确的内容,> https://docs.gitlab.com/omnibus/settings/database.html#configure-postgresql-block
公开Gitlab Omnibus版本的Postgresql。

As the official document explained but not that specific and clear, https://docs.gitlab.com/omnibus/settings/database.html#configure-postgresql-block, to expose the Postgresql from Gitlab Omnibus version。

postgresql ['trust_auth_cidr_addresses'] postgresql ['listen_address'] 很重要,必须一起指定,但是在文档中并没有那么详细。只需仔细调整这两个即可,然后您就可以通过telnet PostgreSQL或使用DBeaver作为sql客户端远程登录它。

postgresql['trust_auth_cidr_addresses'] and postgresql['listen_address'] are important and have to specified together, whereas this details not that much put on the documentation. Just tweak these two carefully then you can telnet PostgreSQL or login it remotely by using DBeaver as a sql client.

这篇关于如何在gitlab omnibus docker容器中或从远程终端访问/登录postgres?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆