How to set up auto re-index in Jira

salahudin911 August 20, 2012

Hi,

I'm relatively new to Confluence / Jira and i've been struggling to set up auto re-indexing of Jira. I was told by Confluence support to download the Confluence Command Line Interface plugin but haven't a clue how to implement this tool in CentOS. Isn't there perhaps a layman's how-to manual to show me the way? My background is Microsoft so...enough said :)

Regards

4 answers

1 accepted

2 votes
Answer accepted
Jason Hensler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2012
3 votes
Razeen Brown May 5, 2013

Hi there,

There are so many customers enquiring about auto-indexing, why doesn't Atlassian just build their new Jira releases with auto-indexing built in?

Regards

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 5, 2013

There aren't actually many asking about it.

Having to re-index the whole system is unusual, and thinking "we should do this regularly" is simply patching over a problem you should really be trying to fix the root cause of.

Sysadmin May 25, 2016

However, any changes done to the plugins require you to perform a re-index on the machine which is not that practical when you have to perform the re-index when the employees leave the office. Performing a background index will decrease the perofrmance on the system... so that is not an option.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2016

Correct, but adding an add-on that requires indexing should be something considered as system maintenance, and the indexing should be done manually by an admin when it is required and the users agree to the downtime.  Not regular indexing.

Sysadmin May 25, 2016

Hi Nic,

Thanks so much for getting back to me even though this is quite an old thread:) I am an administrator myself and I am currently searching for a good tool that can perform this auto re-indexing on our JIRA machine. Our machine is hosted on a Centos Server and running 2 applications both JIRA & Confluence. Do you know of any methods to perform an auto re-index 1 a month for example or every 2 weeks? This can save us a lot of time and also will be very useful when changes are done on our Live System. Performing a re-index because of changes done on the Live system will be done automatically without having to stay here and do a manual re-index. What would you suggest?smile
Thanks very much for your time

Regards

Matt

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2016

You've missed the point.  A desire to do regular re-indexing is indicative of a deeper fault that you need to fix instead of patch over.

If you need to re-index because of config changes, they should be booked with the business and done manually.

Sysadmin May 25, 2016

Hi Nic,

I got your point.... but my point is I WANT to perform an automatic re-index every 2 weeks as we do regular changes in the plugins and workflows very regular in our company. There is no indication of any deeper faults. We are NOT performing a re-index in our system because we have faults in our system which are fixed by a re-index... I don't know whether I am answering your above statement. Instead of performing a manual re-index every 2 weeks because of config changes I would like to install something which can do this re-index automatically during a weekend. Is this possible or not?

Thanks

 

Matt

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2016

Ok, so you've got half the point - you are not re-indexing to patch over a problem.

So, the other reason for re-indexing is config change.  That should be done when the configuration has been changed.  Not 2 weeks later.  You should make the changes and re-index as soon as possible.  Not on a schedule.

Alan Williams February 7, 2019

Hey Nic:

We may also want to do a scheduled re-index as a workaround while we fix the fault.

 

It also may not be possible to re-index right when a change is made.  And since we are human and tend to forget things when post-poned....scheduling an index isn't a bad thing.

 

This should go into an admin's toolbox IMO

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2019

Um, three years later, the advice still stands.  Plus, in those three years, Atlassian have removed more of the indexing options you don't need.

What should go into an admin's toolbox is "not having to think about the index"

Like IT OPS likes this
Deleted user July 8, 2019

Atlassian specifically suggests re-indexing weekly or monthly:
https://confluence.atlassian.com/adminjiraserver/search-indexing-938847710.html

Over time, your instance's disk becomes fragmented from normal use, which slows down your instance. Only the Lock Jira and rebuild index option can address this. This means that, regardless of whether you're running a single- or multi-node instance, you should run a full re-index to address fragmentation periodically (for example, weekly or monthly).

I don't know where your advice is coming from

Like # people like this
ricky.lin April 14, 2020

That's a good point @[deleted] - why would Atlassian's own article recommend a FULL re-index (which makes Jira inaccessible, unless you're on Data Center) on a weekly or monthly schedule if the admin's are not meant to think about the index?  The article was last updated in Oct 2019 and the same verbiage is still there.  The article specifically mentions that running too much background re-index will build up disk fragmentation, so full-reindex is recommended periodically.

It seems like a having the option to do scheduled reindex could definitely be helpful for admins to schedule every few weeks during off hours to help with performance (unless the article is dead wrong)?

2 votes
Danilo Conrad
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2014

From JIRA 6.1 onwards, it is possible to trigger a re-index via the REST API:

https://docs.atlassian.com/jira/REST/6.1/#d2e3239

Alfie Patolilic May 24, 2017

Hi,

I know that this is an old thread.

Just meaning to ask if it would be wise to trigger a scheduled re-index, via a cronjob as you have stated here.

My JIRA instance is of version 6.4.4 at the moment.

I have checked that the using the REST API has some caused some bugs, for example

Would it be better to trigger the re-index from the JIRA UI instead of through the REST API?.

Thanks,

Danilo Conrad
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 24, 2017

Hi Alfie,

Although it is possible to schedule a period re-index, this operation should only be triggered when necessary (e.g. after changes that require a re-index).

The bug JRASERVER-63284 only affects Data Center installations.

Taking that into consideration, if you're running a Data Center version of JIRA, we'd recommend you to trigger the re-index via the UI instead. Otherwise, if you're on JIRA Software Server, either option should be fine.

Cheers

Alfie Patolilic May 26, 2017

Hi Danilo,

Thank you for the reply, even though this is an old thread.

I understand, i will take note of what you have said.

Thank you

 

 

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2012

CLI is a commmand line interface. You will find lot of info, including installation, usage etc, here: https://bobswift.atlassian.net/wiki/display/JCLI/JIRA+Command+Line+Interface

On CentOS, you have shell script that you can run.

salahudin911 August 20, 2012

Thank you kindly sir :)

salahudin911 August 21, 2012

I've come across this post but what do i do with it? Obviously i have to add this to a file and point CLI to it. There isn't really set by step instruction to set this up:

https://confluence.atlassian.com/display/JIRACOM/Automating+JIRA+operations+via+wget?focusedCommentId=229839497#comment-229839497

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 21, 2012

You're getting confused.

The CLI is for making the remote functions easier to use when you're scripting outside.

The script you have found is a script for the sh shell. It's nothing to do with the CLI, you just run it on a Unix box. The "curl" command may need to be added, but all it does is log into Jira and click the "re index" button for you, without a browser.

They both hit Jira remotely (you can run them on any machine that can talk to your Jira), and they don't need a browser. But they're different methods.

Suggest an answer

Log in or Sign up to answer