Skip to end of metadata
Go to start of metadata


Basic info

 

  • Confluence and Jira run in standalone flavour and both have their own Tomcats packaged.
  • Both are installed on /srv partition (/srv/www/confluence and /srv/www/jira), so disk space issues shouldn't be a problem. 
  • Both run as their own users. Please do not run them as root!

Managing services

 

A few useful commands (we're using deamontools to make sure Confluence and Jira run). If Jira or Confluence dies, deamontools are responsible for bringing it up again.

<service> = confluence_standalone or jira_standalone, respectively

 

  • sudo svstat /etc/service/<service> - shows up/down status
  • sudo svc -d /etc/service/<service> - stop the service
  • sudo svc -u /etc/service/<service> - starts the service
  • sudo mltail <service> - shows last lines from console log
  • sudo mltail -f <service> - like above, constantly, equivalent of tail -f
  • sudo mlcat <service> - dumps last 1MB of logs
Above is a preferred way of looking at logs, however, if you're more of a tail -f person, go to:

  • for Confluence Tomcat logs: /srv/www/confluence/atlassian-confluence-4.1.3/logs
  • for Confluence own logs: /srv/www/confluence/confluence-home/logs
  • for Jira Tomcat logs: /srv/www/jira/atlassian-jira-4.4.4-standalone/logs
  • for Jira own logs: /srv/www/jira/jira-home/log

Potential memory issues, the simple way

Both Jira and Confluence need quite a lot of memory. At the moment, they have settings which should be optimal, but in case of problems (with other apps or Java apps /watch out for OutOfMemory exception/ on sushi not having enough memory) settings should be tweaked. This is done in:

  • /srv/www/jira/atlassian-jira-4.4.4-standalone/bin/setenv.sh
    (in the first line, which right now looks like this: JAVA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=384m -XX:+UseCompressedOops $JAVA_OPTS -Djava.awt.headless=true ")
  • /srv/www/confluence/atlassian-confluence-4.1.3/bin/setenv.sh
    (all over the file, setting environment variables /current values listed as well/: 
    JVM_MINIMUM_MEMORY="64m" , JVM_MAXIMUM_MEMORY="320m", JIRA_MAX_PERM_SIZE="256m"
Three most important 
-Xms / JVM_MINIMUM_MEMORY - size of memory used at the start, shouldn't need tweaking unless any of the apps won't start
-Xmx / JVM_MAXIMUM_MEMORY - maximum amount of memory that can be taken for storing data
-XX:MaxPermSize / JIRA_MAX_PERM_SIZE - maximum amount of memory for compiled classes, templates, etc

Maximum amount of memory used up by single application can be estimated doing following calculation: (Xmx + MaxPermSize) * 1.5
If you need to, please tweak memory settings with caution, read a bit of Atlassian wiki and stuff like that - don't make random changes.
 

Confluence: Copy form Production (Sushi) to Staging (Biryani)


To transfer the wiki-related files (executables and data) from sushi to biryani:
root@biryani$ adduser confluence
  -> Home dir will have a different path on biryani than sushi due to
     disk-space allocation issues, but we'll leave symlink as fallback
root@biryani$ ln -s /home/confluence /srv/www/confluence

root@sushi$ cd /srv/www/confluence
root@sushi$ find ! -user confluence
  -> Just in case there was something funny; looks OK

root@sushi$ rsync -va --progress /srv/www/confluence/./ confluence@biryani:/srv/www/confluence/./
 

To transfer the wiki-related databases from sushi to biryani:

root@sushi$ grep hibernate /srv/www/confluence/confluence-home/confluence.cfg.xml
  -> Determine old mysql db/user/pass, e.g. "confluence_new"/"confluence_new"/"pass"

root@biryani$ mysql -u root -p
  -> Create identical mysql db/user/pass
  create database confluence_new;
  GRANT ALL PRIVILEGES ON confluence_new.* TO 'confluence_new'@'localhost' IDENTIFIED BY 'pass';

root@sushi$ mysqldump -u root -p confluence_new \
  | bzip2 > /srv/www/confluence/YYYY-MM-DD-HH-MM-confluence_new.sql.bz2
root@sushi$ chmod og= /srv/www/confluence/YYYY-MM-DD-HH-MM-confluence_new.sql.bz2
root@sushi$ rsync -va --progress /srv/www/confluence/./ confluence@biryani:/srv/www/confluence/./

root@biryani$ bzcat ~confluence/YYYY-MM-DD-HH-MM-confluence_new.sql.bz2 \
  | mysql -u root -p confluence_new

Finally, you can start the new service on biryani. 

Note: The new instance can (at time of writing) be addressed as "http://wiki.dev.civicrm.org:8090/confluence/". Some pages (such as the administrator's "Plugin" screen) may break due to the URL change – fix this by navigating to the Confluence administration area fixing "Configuration => General Configuration => Server Base Url".

Confluence: Upgrade


Labels:

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.