簡體   English   中英

Postgres和Atlassian Jira:驅動程序問題

[英]Postgres and Atlassian Jira: driver issue

我正在嘗試使用32位centOS設置服務器以在其上安裝Atlassian Jira。 我遵循了官方的Atlassian安裝指南, 網址https://confluence.atlassian.com/display/JIRA/Installing+JIRA

現在,我正在運行安裝向導,並且需要配置PostgreSQL數據庫。 在我的centOS上,我通過yum安裝了8.4.20版本。 但是,我在設置Jira時遇到了困難。 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。

我在哪里做錯了?

拒絕連接。 檢查主機名和端口是否正確以及郵局主管正在接受TCP / IP連接。

默認情況下,PostgreSQL僅偵聽本地環回接口,因此無法連接到公共IP。 如果要從localhost連接,則無論如何都不需要,只需使用localhost

嚴重:用戶“ jiradbuser”的身份驗證失敗

這很好,表明您已成功連接到PostgreSQL,然后在嘗試登錄時收到身份驗證錯誤。

PostgreSQL服務器安裝默認為對TCP / IP連接進行ident驗證,但是JIRA應用程序不在名為“ jiradbuser”的Unix用戶下運行,因此連接被拒絕。 更改pg_hba.conf以使用md5代替ident並為用戶設置密碼。 請參閱文檔中的客戶端身份驗證一章 ,尤其是pg_hba.conf

找不到適用於jdbc的驅動程序:postgresql:// http://:5432 / jiradb

我不知道您認為URL可以正常工作...

您想要類似的東西:

jdbc:postgresql://localhost:5432/jiradb

我有同樣的問題。 我可以解決它,將Maven存儲庫中的Postgres驅動程序.jar設置為\\ target \\ jira \\ webapp \\ WEB-INF \\ lib \\

在這里,這個問題很晚了,但我想我會加一點幫助未來,倒退:

找不到適用於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

嚴重:用戶“ 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集群(使用stop and start,而不使用'restart'選項),然后測試從命令行進行的連接。

如何從命令行測試連接

如果您使用安裝的postgres工具登錄到UNIX系統,則您應該能夠模仿JIRA服務器將嘗試連接到數據庫的連接嘗試。 如果您不能從命令行連接到新的postgresql db,那么JIRA也無法實現。 另外,您將獲得更好的錯誤消息。 因此,只需打開外殼程序並輸入(在適當的位置替換變量-'<'和'>'字符內的內容),這些值的所有值都在您的頭部和postgresql.conf文件中:

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

一旦您可以從命令行連接,JIRA也將是一個不錯的選擇-沒什么希望,但您將立足之本。

...嗯...現在,希望可以幫助某人...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM