当前位置: 首页 > 知识库问答 >
问题:

Postgres和Atlassian Jira:车手问题

邢宏浚
2023-03-14

我试图用centOS 32位安装一个服务器在上面安装艾特莱森Jira我按照官方艾特莱森安装指南在https://confluence.atlassian.com/display/JIRA/InstallingJIRA

现在我正在运行安装向导,需要配置PostgreSQL数据库。在centOS上,我通过yum安装了8.4.20版。然而,我很难设置吉拉。Postgres正在运行,我可以通过Linux控制台登录,但当我测试与数据库的连接时,我发现以下错误:

Error connecting to database
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Connection refused

此外,当我键入完整的公共IP地址时,会出现此错误。如果我插入localhost,我会得到:

Error connecting to database
FATAL: Ident authentication failed for user "jiradbuser"

如果我插入

http://<public ip> 

我得到以下信息:

Error connecting to database
No suitable driver found for jdbc:postgresql://http://<public ip>:5432/jiradb

然而,我把我的jdbc驱动程序放在了/opt/atlassian/jira/lib中,它的名字是postgresql-8.4-703。jdbc4。罐子Postgresql版本是8.4.20。

我哪里做错了?

共有3个答案

孙鑫鹏
2023-03-14

这个问题已经很晚了,但我想我应该补充一点来帮助未来,倒退:

没有为jdbc找到合适的驱动程序

    A while ago Atlassian didn't distribute the PostGreSQL JDBC driver file with the JIRA releases. They have been doing this for a while now (I'd say since mid 2013) - regardless, the driver file belongs in the <jira-base>/lib directory unless you are doing a WAR install, in which case you shouldn't, and just put the driver file in the lib directory anyway

FATAL:用户"jiradbuser"的身份验证失败

1. Listen on a socket if you need to - The best approach to this is to look at your JDBC driver URL - if it has an IP/hostname other than 127.x.x.x or 'localhost' you need to modify PostGreSQL to listen to a TCP port by modifying your postgresql.conf file to enable listening on ports. Just find the file, back it up, then open it and search for localhost, read the file comments and make the correct change. If you find yourself looking around in multiple locations in the file or changing more than a single word you are trying too hard - restore your backup and try again. Just remember to *stop* and *start* your postgres db cluster when you are done

2. enable the correct login METHOD in pg_hba.conf (same directory as the postgresql.conf file - on unix typically under /etc/postgresql/<version>/main/.) - this is difficult to writeup in brief but I'll try
    1. backup the pg_hba.conf file - I ain't foolin, this is something you'll be happy with later - back the sucker up
    2. edit the file 
    3. go to the bottom of the file - look for the last line like "# TYPE  DATABASE        USER            ADDRESS                 METHOD"
    4. comment out every line under this 'table heading' line
        - the reason to do this is that the package maintainers often fall back to commenting here and so you'll have 2 commented out lines and then one line that isn't commented out - and you'll never notice it - it's easiest to just start off with commenting out the whole block of stuff so there isn't a single uncommented line in the file
        - add a two lines for the postgres user to connect local and to a db socket unless your corporate security does not allow - something like this:
        local   all             postgres        127.0.0.1/32     peer 
        host    all             postgres        127.0.0.1/32     trust
        - add a line for your jiradbuser to connect to the newly created database via sockets with md5 encryption. md5 isn't the best - there are other options to google - if you use md5, it'd look something like this:
        host    jiraversiondb   jiradbuser      127.0.0.1/32     md5

然后保存文件,重启postgres集群(带有停止和启动,而不是“重启”选项),并从命令行测试连接。

如何从命令行测试连接

如果您使用postgres工具登录到unix系统,您应该能够模拟JIRA服务器尝试连接到数据库的连接尝试。如果您无法从命令行连接到新的postgresql db,那么JIRA也很有可能无法连接到。另外,您会收到更好的错误消息。因此,要做到这一点,只需打开一个shell并输入(在适当的地方替换变量——“

psql --port <port - default is 5434> --username=<db user name> --password --dbname=<database name>

一旦你可以从命令行连接,JIRA肯定也会这样做——没有promise,但你会有良好的基础。

...啊。。。。现在,这将有望帮助某人。。。

杜联
2023-03-14

我遇到了同样的问题。我可以解决它,将postgres驱动程序从maven存储库中设置为\目标\jira\webapp\WEB-INF\lib\

戚宏浚
2023-03-14

连接被拒绝。检查主机名和端口是否正确,邮政局长是否接受TCP/IP连接。

默认情况下,PostgreSQL只在本地环回接口上侦听,因此无法连接到公共IP。如果您是从localhost连接的,则无需使用,localhost

FATAL:用户"jiradbuser"的身份验证失败

这很好,它表明您成功连接到PostgreSQL,然后在尝试登录时出现身份验证错误。

PostgreSQL服务器安装默认为TCP/IP连接的ident身份验证,但是JIRA应用程序没有在名为jiradbuser的unix用户下运行,因此连接被拒绝。更改pg_hba.conf以使用md5而不是ident并为用户设置密码。请参阅文档中的客户端身份验证章节,特别是pg_hba.conf

没有找到适合jdbc的驱动程序:postgresql://http://:5432/jiradb

我不知道你从哪里得到这个网址会起作用的想法...

你想要的是:

jdbc:postgresql://localhost:5432/jiradb
 类似资料:
  • 已更新 无法连接到postgres数据库。postgres的依赖关系是通过Maven添加的。 Maven依赖项 Postgres池 获取连接的代码 如果您有相同的问题,请将代码更改为:

  • 问题内容: 我必须使用分布在不同机器上且都在运行linux的几个postgresql数据库进行模拟。 我已经成功地从源代码编译并构建了postgresql,我也可以运行服务器,但是当我尝试使用此命令创建新的数据库时: 我收到此错误: 其中giulio是我用于访问所有计算机的用户名。 在某些机器上它可以工作,而在其他机器上则不能。我真的无法弄清楚问题的根源。我想这与postgres的访问控制有关。

  • 大话GraphQL新手上车 GraphQL是什么? GraphQL 既是一种用于API的查询语言也是一个满足你数据查询的运行时(来自:官方解释) 理解起来就是,GraphQL有自己查询语法,发起的API请求中通过传递查询语句来告诉服务端需要哪些操作和具体数据字段,GraphQL定义了实现规范,各种的语言分别实现了GraphQL功能框架,通过框架可以对查询语法进行解释执行,然后返回数据输出给客户端

  • 对于这个程序,实例变量的创建和模型需要是一个字符串,价格需要是我已经有的两倍,但不确定如何处理需要是int类型的年份,大于1900。然后我需要用参数做一个构造函数,我也做了,但是toString需要用setter和getters方法返回Car对象的字符串表示。所以我在试图为setter想出一些东西时遇到了问题,如果我做对了这一部分。 这部分是Cartest驱动程序,我不确定我这样做是否正确。我必须

  • 问题内容: 我正在使用Hibernate 4.0将jpegs存储到postgres 9.1.4中(jdbc是postgresql-9.1-901.jdbc4.jar)bytea列(byte []是hibernate实体,没有额外的类型def)。 hibernate存储过程工作正常,因为我可以使用数据库工具来转储bytea列并仍然获取jpeg。基本上是: 在managedBean中 此时,字节看起来

  • 作为学习r2DBC的一部分,我遇到了Enum转换面临的问题。我在这里使用PostgreSQL。当读取评级为PG-13和NC-17(任何带破折号的东西)的电影数据时,我面临问题。 下面是我的表模式 mpaa_rating定义为 这是我的代码,它在我的配置中注册转换器 我的检索代码很简单 添加引发的异常https://gist.github.com/harryalto/bd51bbcdd081868c