无法通过internet连接到tryton(postgresql)
我在本地安装了tryton。但是从远程客户端连接不起作用。 tryton是在PostgreSQL上构建的,根据文档,我认为问题的本质就在这里无法通过internet连接到tryton(postgresql),postgresql,connection,tryton,Postgresql,Connection,Tryton,我在本地安装了tryton。但是从远程客户端连接不起作用。 tryton是在PostgreSQL上构建的,根据文档,我认为问题的本质就在这里 编辑: 事实证明,问题不仅仅在于PostgreSQL或trytond.conf脚本,而是我需要在Windows Azure上为端口8000的虚拟机设置中添加一个端点。 看见 但是,下面关于trytond.conf文件的答案也是正确的 在/etc/trytond.conf中,我输入了tryton服务器的IP地址: #This file is part o
编辑: 事实证明,问题不仅仅在于PostgreSQL或trytond.conf脚本,而是我需要在Windows Azure上为端口8000的虚拟机设置中添加一个端点。 看见 但是,下面关于trytond.conf文件的答案也是正确的
在/etc/trytond.conf中,我输入了tryton服务器的IP地址:
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
[options]
# This is the hostname used when generating tryton URI
#hostname =
# Activate the json-rpc protocol
jsonrpc = 23.97.165.118:8000
#ssl_jsonrpc = False
(这是一个示例IP)
运行常见问题解答中的检查:
trytond正在正确运行:
侦听端口:
但是,无法通过internet与客户端进行连接
我希望互联网上任何地方的每一个客户端都能够连接(这不是安全方面的最佳选择,但用户的IP会发生变化,因此无法避免这种情况)
我必须在/etc/postgresql/9.1/main/pg_hba.conf中输入什么
需要进入postgresql.conf的是什么?
在哪一个?使用“whereis postgresql.conf”搜索可找到多个版本:
root@Tryton:~# whereis postgresql.conf
postgresql: /etc/postgresql /usr/lib/postgresql /usr/share/postgresql
非常感谢您事先的帮助
编辑:以下是配置文件。在服务器上本地运行正常,但无法通过internet连接tryton客户端
配置文件(更改)
trytond.conf
pg_hba.conf
postgresql.conf
由于postgresql连接是从服务器完成的,因此没有与postgresql相关的问题,因此问题在于配置文件,而恰恰是jsonrpc选项 基本上,此设置用于说明哪个本地接口/ip将尝试侦听连接: 因此,如果您使用: jsonrpc=23.97.165.118:8000 服务器将在23.97.165.118上侦听,并且只接受与目标23.97.165.118的连接,因此当localhost映射到127.0.0.1时,您将无法访问它 如上所述,我将使用以下设置重新结束: jsonrpc=*:8000 它将侦听服务器的所有接口(localhost和您拥有的任何外部连接)
注意:必须重新启动tryton服务器才能应用配置文件中的更改 我也有同样的问题,而公认答案中的建议实际上是我麻烦的原因。(至少对于最新版本,3.4至3.8)如下所示:
[jsonrpc]
listen = *:8000
还尝试从Windows通过PgAdmin直接连接到PostgreSQL,按照过程更改postgres的用户角色并在中配置各种文件[,但也无法从PgAdmin连接。这是我在/etc/中的trytond.conf:我试图ping Azure上的VM。但是Azure不允许ping,因为负载平衡器只允许基于TCP的流量通过,除非您使用Azure connect。因此,我仍然想知道如何检查端口8000(Tryton需要此端口)完全可以访问。我对Azure不太了解,但从您的评论中我了解到,有防火墙阻止了您机器的端口8000。可能此帖子可用于在windows Azure上打开端口8000:请检查您是否已打开端口8000。
# PostgreSQL Client Authentication Configuration File
# ===================================================
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local all postgres md5
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
# Original:
#host all all 127.0.0.1/32 md5
# Neu:
# Option 1: host all all 0.0.0.0/0 md5
host all all 127.0.0.1/32 md5
# IPv6 local connections:
# Original:
#host all all ::1/128 md5
# Neu:
host all all ::/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
[jsonrpc]
listen = *:8000