Tag: JIRA



15 十 09

前言:

虽然很多人都会说在同一台服务器上安装两个JIRA实例没有必要,因为JIRA可以设置很多的项目,并且独立的设置权限。但需要两个实例的情况也不是没有,如领导不喜欢看到其它无关的项目,完全不同的部门不想共用同一个等。这种需求肯定是有的,我就碰到了啊。只要有一定经验的人都会安装过这种类似的多个实例在同台服务器的情况,但每种软件的方法总会有特殊的一些地方。下面大概的介绍下安装方法。

注意事项:

在安装JIRA之前先做个说明

1、安装JIRA的过程 参考 Linux JIRA+MYSQL安装与调试方法

2、本次安装的版本是 atlassian-jira-enterprise-3.13.5-standalone
其实在安装这个版本的时候 jira 4.0已经出来了,并且尝试了很久但都是以失败告终,jira 4 有两大难点,第一个是Jira的license 升级后很多不能用,网上也没有新的破解方法,要短时间内搞出来不容易;第二个就是域名代理会出问题 即直接用80域名端口访问的时候(放在apache 或者nginx 后面) 新的jira 首页设计成Gadgets的方式,而这个URL是相对的会因为代理的问题导致不能得到正确的URL地址 现在官网只有apache的解决办法,很不幸我用的是nginx ,所以实验没有成功 ,具体方法见官网 Gadgets do not display correctly after upgrade to JIRA 4.0

安装原理:

借人别人的话

* all app server ports are unique for each JIRA instance
* separate context paths in your jira.xml file
* each JIRA instance points to a unique database
* each JIRA instance points to a unique index directory
* each JIRA instance points to a unique attachment directory

所有的端口、目录、数据库、附件、索引目录都需要独立。

安装过程:

1、新的jira按第一个jira的安装方法进行 参考 Linux JIRA+MYSQL安装与调试方法

2、创建新的数据库,并且设置权限

3、配置区别一、更换下面jiradb为新的数据库

url="jdbc:mysql://localhost/jiradb? autoReconnect=true&useUnicode=true&characterEncoding=UTF8"

4、配置区别二、设置不同的端口

设置的有一个服务端口、一个连接端口、一个服务实例名称、一个引擎名称(其实不太了解Engine name 有知道的告诉我下 平时都是搞PHP环境的)(以下代码不可复制,编辑器把一些字符转成全角了)

<Server port=”8006” shutdown=”SHUTDOWN”>

<Service name=”NewJIRA“>

<Connector port=”8888

maxHttpHeaderSize=”8192″ maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″ useBodyEncodingForURI=”true”

enableLookups=”false” redirectPort=”8443″ acceptCount=”100″ connectionTimeout=”20000″ disableUploadTimeout=”true” />

<Engine name=”NewJIRA” defaultHost=”localhost”>

<Host name=”localhost” appBase=”webapps” unpackWARs=”true” autoDeploy=”true”>

5、配置区别三、这个区别主要是针对jira 4.0的

其实如果不配置域名的反向代理,jira 4.0也是可以正常配置在同一台服务器上的。

1)JIRA 4.0的安装比较严格些,在WEB配置的时候会必需填写附件、索引路径
2)需要设置jira.home  编辑./atlassian-jira/WEB-INF/classes/jira-application.properties 把jira.home的目录更改到新的jira目录(3.X版本都是没有这个jira.home)

如何设置jira.home 还有解jira.home的锁 lock 请参考官网的方法 Setting your JIRA Home Directory

------------------------------------------

以上配置就已经通过不同的端口来访问JIRA了

6、反向代理域名访问方法设置

原理:WEB软件上设置将虚拟主机的80端口转到后端的jira端口,通过虚拟主机来访问

这里只说Nginx Apache的网上搜搜到处都是。

1)nginx.conf 设置代理

upstream jira {
server 127.0.0.1:8080;
}
upstream newjira{
server  127.0.0.1:8888;
}

2)vhost.conf 设置虚拟主机

server {
listen 80;
server_name renwu.com www.renwu.com *.renwu.com;
charset utf-8;

location / {
index index.jsp index.html index.htm;
proxy_pass http://jira;
}
}

server {
listen 80;
server_name renwu2.com www.renwu2.com *.renwu2.com;
charset utf-8;
location / {
index index.jsp index.html index.htm;
proxy_pass http://newjira;
}
}

(END)

注意结合 Linux JIRA+MYSQL安装与调试方法 来配置








28 七 09

前言:  上次刚安装完JIRA 13.4没两天 JIRA又升级到13.5了,都想用最新的,而且同事说汉化得不好,想看看新的版本,正好之前的JIRA还没有怎么用,那就开始折腾他。升级吧。

升级要求:

虽然数据不多,但尽量保存数据,再花那么久时间去创建用户项目也是个麻烦的事。(不过我是抱着折腾的想法去做的,因为没有太重要的数据,数据不丢失当然是最好,結果当然是一切顺利,数据完好)

升级软件:

atlassian-jira-enterprise-3.13.4-standalone升级到atlassian-jira-enterprise-3.13.5-standalone

升级步骤:

注意:要继续下面的请先参考我的之前的JIRA安装“Linux JIRA+MYSQL安装与调试方法

第一步:下载3.13.5

到官网下载就行了,之前那篇文章有。

其实在下载的页面可以看到 install guide 和upgrade guide 完全可以参考上面的,也是比较詳細了,不过我看了一眼就觉得太麻烦了,其实可以简化很多的。

http://www.atlassian.com/software/jira/docs/latest/upgrading.html

第二步:解压并同步一些文件

安装文章里有这个配置 ln -s atlassian-jira-enterprise-3.13.4-standalone jira

这个方法其实很方便尤其在更新的时候

tar zxvf atlassian-jira-enterprise-3.13.5-standalone.tar.gz
rm jira
ln -s atlassian-jira-enterprise-3.13.5-standalone jira

同步MYSQL/JDBC驱动

cp atlassian-jira-enterprise-3.13.4/common/lib/mysql-connector-java-5.0.8-bin.jar  atlassian-jira-enterprise-3.13.5/common/lib/

同步 WEB相关的文件 如附件等

cp -r atlassian-jira-enterprise-3.13.4-standalone/website/*  jira/website/

website下面的如果不同步,会出现一些内容丢失、是在系统日志中查看到的,会找不到东西。

第三步:再一次修改JIRA配置

这个是跟原来安装文档中一样的修改两个配置文件。

第四步:安全保险,备份JIRA数据库

这样WEB程序和数据库都不少,如果出错还有后退的余地。

第五步:删除原来的jira进程,重启startup.sh

起来后使用tail -f jira/logs/catalina.out  查看错误,如还有其它问题首先检查上面的是否都注意做了,有新的问题google.

如果按之前我的那篇文章安装的,又用这篇文章进行的升级,应该是没有问题了,我的一气哈成,都是看日志进行的调试。

JIRA操作小记录:

1、所有的配置在管理里都是可以修改的 ,如组的权限 报告问题的类型英文改中文或者添加等等(所以之前同事说的大部分英文问题都可以解决了)

2、登陆名最好用英文 如果是中文创建和使用都没有问题 就是在删除的时候会报ava.lang.UnsupportedOperationException: Could not remove user: ??? to group: jira-developers

显然是对中文支持的不好,暂时没有解决。我看还是用英文吧。

3、建立好了用户不要经常删除重建,会有很多关联的东西,可能会比较麻烦哦。

暂时这些(END)







15 七 09

前言:应同事要求 想搭建一个BUG的提交系统,用来有效的管理项目,所以选用了jirajira基于J2EE的 ,之前一直接触的都是PHP的平台相关的程序,这次也当是正好练习下JAVA方面的环境安装调试,中间也是出了不少的问题,至少学会了一个最重要的如何调 试tomcat

一、了解JIRA

不管你知不知道JIRA 还是先大概的了解下。

(大致归纳下)JIRA 是目前比较流行的基于Java架构的管理系统  ,是集项目计划、任务分配、需求管理、错误跟踪于一体的商业软件,功能全面,界面友好,安装简单,配置灵活,权限管理以及可扩展性方面都十分出色。

因为是基于JAVA的所以需要JAVA环境,因为是商业软件所以会要有license key

二、具体安装过程(含有解决问题的分析思路)

1、基础环境(以自己实践的环境为例)

操作系统: Linux (具体用过的Centos 5.2 , Slackware 12.1

2、思考过程

可能拿到一个要安装的软件可能第一反应就是google搜索,但往往网上的文章基本没有绝对完整或者是时效性已经过了的。

正确的思考方式

A、直接下载JIRA程序,安装方法查看解压包中的README.txt 或者有些软件包还有一个INSTALL

B、以JIRA的官方安装方法为基准 再参考google搜索出来的其他文章。

C、遇到具体再具体分析。

3、下载JIRA

JIRA 官网:http://www.atlassian.com/software/jira/

下载企业版:wget http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-enterprise-3.13.4-standalone.tar.gz

tar zxvf atlassian-jira-enterprise-3.13.4-standalone.tar.gz

mv atlassian-jira-enterprise-3.13.4-standalone /home/

ln -s atlassian-jira-enterprise-3.13.4-standalone jira

cd /home/jira

4、根据README.txt安装

———————————————————————

JIRA 3.13.4-#354 README

———————————————————————

Thank you for downloading JIRA 3.13.4 – Standalone distribution. This

distribution comes with a built-in Tomcat 5.5.26 web server and hsql

database, so it runs (almost) out the box.

JIRA 3.13.4集成内置了tomcat 5.5.26的 默认是hsql database

所以不需要另外安装tomcat

BRIEF INSTALL GUIDE

——————-

1. Install a Java Development Kit (JDK) from

第一步:安装JDK环境

JDK下载路径

http://java.sun.com/javase/downloads/index.jsp

(avoid JREs, Java EEs, Netbeans, etc. on that page – you just want a JDK).

下载最新的JDK

这里的最新版本是JDK 6 Update 14 注意的是选择完平台进行下载的时候 可以直接点击jdk-6u14-linux-i586.bin 进行下载 如果是点击“download selected with sun download manager” 这个是SUN的下载器

2. Set the JAVA_HOME variable to where you installed Java. Windows installers

may do this for you. See also the following for Windows instructions:

http://confluence.atlassian.com/display/DOC/Set+JAVA_HOME+variable+in+Windows

第二步 :安装和配置JAVA环境

JAVA安装很简单主要是配置变量 这里不清楚了可以google下了

参考这篇文章:http://www.tj4c.com/2009/06/25/linux-install-jdk/

我的步骤:

chmod +x jdk-6u14-linux-i586.bin

./jdk-6u14-linux-i586.bin

mv jdk1.6.0_14 /usr/local/jdk

/etc/profile尾添加

JAVA_HOME=/usr/local/jdk

CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar

PATH=$JAVA_HOME/bin:$PATH

export JAVA_HOME

export PATH

export CLASSPATH

还需要在终端中把上面添加的都执行一遍,不然你想重启机器啊,呵呵。

查看是否成功:

java -version

java version “1.6.0_14″

Java(TM) SE Runtime Environment (build 1.6.0_14-b08)

Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)

也可以编写个hello.java测试下 (略)

README中对WINDOWS关爱有加 有WINODWS的配置JDKURL

第三步:配置MYSQL

下面的第3是开始启动JIRA了,但我们的需求是安装JIRAMYSQL的,所以还需要配置MYSQL

如果不想麻烦建议就用操作系统自带的MYSQL吧 (MYSQL配置自己查)

(以下的JIRAMYSQL配置参考 官网资料 http://confluence.atlassian.com/display/JIRA/Setting+up+JIRA+Standalone+and+MySQL+on+Linux

slackware 12.1 centos 5.2 MYSQL都是5.0

JIRAMYSQL配置

mysql
create database jiradb character set utf8;
grant all privileges on jiradb.* to jirauser@localhost identified by 'mypassword' with grant option;
flush privileges;
quit
测试是否成功 用jirauser用户手动登陆试试
第四步:安装MYSQL/J JDBC 驱动
       作用就是让JAVA可以通过JDBC连接MYSQL
下载:http://dev.mysql.com/downloads/connector/j/5.1.html
JDBC下载要跟你的MYSQL基本相同  mysql 5.0选择5.0的驱动 依以类推
wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.0.8.tar.gz/from/ftp://ftp.jaist.ac.jp/pub/mysql/
tar zxvf mysql-connector-java-5.0.8.tar.gz
cp mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar /home/jira/common/lib
第五步:修改JIRA配置
修改一、
vim /home/jira/conf/server.xml
修改成如下几项
username="jirauser"
 password="mypassword"
 driverClassName="com.mysql.jdbc.Driver"
 url="jdbc:mysql://localhost/jiradb? autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"
删除以下两行
  minEvictableIdleTimeMillis="4000"
 timeBetweenEvictionRunsMillis="5000"
修改二、
vim /home/jira/atlassian-jira/WEB_INF/classes/entityengine.xml
将其中的hsql改成mysql 数据库类型<datasource name="defaultDS" field-type-name="hsql"
<datasource name="defaultDS" field-type-name="mysql"
删除    schema-name="PUBLIC"

3. Run bin/startup.sh (*nix) or bin\startup.bat (Windows). Check that there

are no errors on the console. See below for troubleshooting advice.

第六步:运行JIRA服务

*uix使用JIRA根目录下的bin/starup.sh windowsbin\startup.bat

运行后可以通过logs下的日志进行查看报错

4. Point your browser at http://localhost:8080/

You should see JIRA’s Setup Wizard.

第七步:访问JIRA

通过http://JIRA_server_ip:8080 进行查看 如果出来界面说明配置正确 如果报404等其它问题就是配置中出现问题了

通过仔细检查配置文件都没有改错或者写错的话 那么很有可能就是你的MYSQL连接不正确
三、问题排错

可能大部分的人第一次安装都不会那么顺利,我就是遇到了不少的问题,如何进行排错呢,日志是肯定不能少的。

出现问题后查看 logs下面的catalina.2009-07-14.log catalina.out 日志 但只能得到两个错误

SEVERE: Error listenerStart

SEVERE: Context [] startup failed due to previous errors

通过google查看 这类问题不少,也有很多的解决办法 如:http://xuthus.javaeye.com/blog/85089

但这都不是解决办法的根源,因为报这个错还是有很多种可能。

解决办法查看最詳細的日志,确定问题的原因:http://618119.com/archives/2007/12/04/37.html

JIRAtomcat5.5的 基于上面的方法

参考APACHE的官网资料: http://tomcat.apache.org/tomcat-5.5-doc/logging.html

1、创建log4j.properties

vim /home/jira/common/classes/log4j.properties

            log4j.rootLogger=DEBUG, R
            log4j.appender.R=org.apache.log4j.RollingFileAppender
            log4j.appender.R.File=${catalina.home}/logs/tomcat.log
            log4j.appender.R.MaxFileSize=10MB
            log4j.appender.R.MaxBackupIndex=10
            log4j.appender.R.layout=org.apache.log4j.PatternLayout
            log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

2、下载 log4j

wget http://apache.freelamp.com/logging/log4j/1.2.15/apache-log4j-1.2.15.tar.gz

tar zxvf apache-log4j-1.2.15.tar.gz

cp apache-log4j-1.2.15/log4j-1.2.15.jar /home/jira/common/lib/

3、下载commons logging

wget http://apache.freelamp.com/commons/logging/binaries/commons-logging-1.1.1-bin.tar.gz

tar zxvf commons-logging-1.1.1-bin.tar.gz

cp commons-logging-1.1.1/commons-logging-1.1.1.jar /home/jira/common/lib/

这样配置完后 重启JIRA可以在日志中看到更詳細的记录

第一个就是在当前启动JIRA服务的目录下会产生atlassian-jira.log

tail -f atlassian-jira.log

第二个在logs中的catalina.out 跟上面的日志内容是一样的

分析:

以下就我出现的问题具体分析下日志:

日志取最早出现的error

问题Amain ERROR [jira.appconsistency.db.DatabaseConsistencyCheck] There was a SQL exception checking for database driver correctness. Skipping

2009-07-14 17:12:57,743 main ERROR [core.entity.jdbc.DatabaseUtil] Unable to esablish a connection with the database… Error was:org.apache.tomcat.dbcp.dbcp.SQLNestedExceptio

n: Cannot load JDBC driver class ‘org.mysql.jdbc.Driver’

这个是名字打错了,几次折腾重新安装时把驱动的名字打错了 应该把 ‘org.mysql.jdbc.Driver’改成

‘com.mysql.jdbc.Driver’

问题Borg.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: ‘java.net.ConnectException: Connection refused’.

连接被拒绝了,其实这个原因是一直没有成功的根源,我当时用的是slackware 12.1的默认mysql的服务启动是skip-network 即是不能通过网络访问的,但手动本地localhost是可以的所以连接的,所以带来了问题的麻烦

解决:去掉启动脚本中的—skip-network

问题Crg.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: ‘java.sql.SQLException: Access denied for user ‘jirauser’@'127.0.0.1′ (using password: YES)’.

还是访问被拒绝但已经有明显的访问方式为jirauser’@'127.0.0.1′ ,这个很奇怪,为什么配置中用的是localhost却用127.0.0.1来访问,虽然逻辑上是一样的,但mysql好像不能区分,所以又给127.0.0.1添加了一条权限

解决:grant all privileges on jiradb.* to jirauser@’127.0.0.1′ identified by ‘mypassword’ with grant option;

最后看到日志中出了

Database configuration OK

___ Database Configuration _______

Loading entityengine.xml from : file:/home/atlassian-jira-enterprise-3.13.4-standalone/atlassian-jira/WEB-INF/classes/entityengine.xml

Entity model data source name : defaultDS

Entity model field type name : mysql

Entity model schema name :

Database Version : MySQL – 5.0.51b-log

Database Driver : MySQL-AB JDBC Driver – mysql-connector-java-5.0.5 ( $Date: 2007-03-01 00:01:06 +0100 (Thu, 01 Mar 2007) $, $Revision: 6329 $ )

Database URL : jdbc:mysql://localhost:3306/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8

Database JNDI address : java:comp/env/jdbc/JiraDS

说明成功了
四、JIRA界面配置

这个就不詳細说了,具体看官网资料 图文并茂http://www.atlassian.com/software/jira/docs/v3.13/setup.html

其它的资料见README中的其它URL

Full documentation is available online at:

http://www.atlassian.com/software/jira/docs/v3.13.4/install.html

PROBLEMS?

———

A common startup problem is when another program has claimed port 8080, which

JIRA is configured to run on by default. To avoid this port conflict, JIRA’s

port can be changed in conf/server.xml.

If you have installation (or other) problems, please see the resources

listed at https://support.atlassian.com

QUESTIONS?

———-

Questions? Try the docs at:

http://www.atlassian.com/software/jira/docs/v3.13.4/

Alternatively ask on the forums at:

http://forums.atlassian.com/index.jspa

or ask Atlassian directly – see the contact info at

https://support.atlassian.com

成功的截图

jira1