2014-09-22 36 views
0

我想安装一个带有centOS 32位的服务器来安装Atlassian Jira。 我遵循官方的Atlassian安装指南https://confluence.atlassian.com/display/JIRA/Installing+JIRAPostgres和Atlassian Jira:驱动程序问题

现在我正在运行安装向导,我需要配置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地址出现此错误。如果我插入本地主机,我得到这个:

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.jar。 Postgresql版本是8.4.20。

我在哪里做错了?

+0

为什么使用PostgreSQL的这样一个过时的版本?对于新的安装,你应该使用9.3。如果JIRA指定你必须使用8.4,那么他们需要在这十年中获得。 – 2014-09-22 14:20:14

+0

我正在使用该版本,因为这是我用yum install postgresql-server命令安装的。我很乐意切换到更新的版本。 – Manu 2014-09-22 14:21:14

+0

啊,所以你在一个老的操作系统上,也许是RHEL6/CentOS 6.在这种情况下,请参阅http://yum.postgresql.org/。不要使用旧的PostgreSQL开始新的部署。 (虽然这不是你遇到的问题)。 – 2014-09-22 14:24:19

回答

4

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

默认情况下,PostgreSQL只在本地环回接口上侦听,所以连接到公网IP将不起作用。如果你从本地主机连接,你不需要,只需使用localhost

FATAL: Ident authentication failed for user "jiradbuser"

这是一件好事,它表明你连接到PostgreSQL成功,然后让试图登录时的身份验证错误。

你的PostgreSQL服务器安装默认为ident认证的TCP/IP连接,但JIRA应用程序未在名为“jiradbuser”的unix用户下运行,因此连接被拒绝。更改pg_hba.conf以使用md5而不是ident并为用户设置密码。见the client authentication chapter in the docs,特别是pg_hba.conf

No suitable driver found for jdbc:postgresql://http://:5432/jiradb

我不知道从哪里得到的想法,该URL会工作......

你想要的东西,如:

jdbc:postgresql://localhost:5432/jiradb 
+0

,我试过了,我得到的错误是关于驱动程序的。关于你的第二点,我建立了你所说的pg_hba.conf。关于第三点,这是一个复制和粘贴的问题(无论是在配置中还是在线程中)。 – Manu 2014-09-22 14:32:58

+1

@Manu如果您在pg_hba.conf中更改为'md5',那么您很可能忘记了之后重新启动/重新加载PostgreSQL,或者您忘记了配置更改。如果有疑问,请在对问题进行编辑时显示完整的“pg_hba.conf”。 – 2014-09-22 14:36:31

+1

@Manu,从你的回复中不清楚你究竟复制和粘贴了什么(是SO或者你的配置中的C + P错误?)。正如Craig所写,在你的JDBC字符串的任何地方都不应该有“http://”。如果您收到有关找不到合适驱动程序的错误,则表示您的JDBC字符串格式不正确。你能发布你在使用loopback接口时使用的确切的JDBC字符串吗?(或者您提供给安装程序的输入屏幕截图?) – 2014-09-22 14:55:40

1

我有同样的问题。我可以解决它设置postgres驱动程序。从Maven仓库罐子\目标\ JIRA \ web应用\ WEB-INF \ lib中\

0

漂亮的晚了这里的问题,但认为我会添加一些位助阵未来,倒退:

身份认证失败,用户 “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 
012: 发现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没有合适的驱动程序

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

如何测试命令行

连接如果您登录到安装了Postgres的工具,在Unix系统上,你应该能够模仿尝试连接该JIRA服务器将尝试连接到数据库。如果你不能从命令行连接到新的postgresql数据库,那么JIRA将无法做到这一点。另外你会得到更好的错误信息。所以要做到这一点,只需调出一个shell并输入(在适当的位置替换变量 - '<'和'>'字符中的内容) - 所有这些值都在您的头部和postgresql.conf文件中:

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

一旦你可以从命令行连接,这是一个很好的选择JIRA也会 - 没有任何承诺,但是你将会站稳脚跟。

...啊啊啊....现在,该会希望帮助别人...