# Install

In order to index records and files you will need to complete these steps

1. Install standalone Elastic search server
2. Install and configure Tempus Serva file indexing
3. Configure the Tempus Serva installation

Finally you may want to install optional components to handle OCR (scanned PDF's and images)

### <span class="mw-headline" id="bkmrk-install-elastic-sear-1">Install Elastic search</span>

#### <span id="bkmrk-"></span><span class="mw-headline" id="bkmrk-java-8-%2F-elastic-sea-1">Java 8 / Elastic search 6</span>

This is the recommended version but requires Java 8.

Follow these steps:

```
 sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
 sudo sh -c 'curl https://gist.githubusercontent.com/nl5887/b4a56bfd84501c2b2afb/raw/elasticsearch.repo >> /etc/yum.repos.d/elasticsearch.repo'
 sudo yum update -y
 sudo yum install -y elasticsearch
 sudo chkconfig elasticsearch on
```

The service runner configurations should have updated RAM allowance by adding an extra line in the file

```
  sudo nano /etc/sysctl.conf
  vm.max_map_count=262144
```

Restart service and validate settings were updated

```
  sudo sysctl --system
  sysctl vm.max_map_count
```

Run the daemon

```
 sudo service elasticsearch start
```

#### <span id="bkmrk--1"></span><span class="mw-headline" id="bkmrk-java-7-%2F-elastic-sea-1">Java 7 / Elastic search 1.7</span>

This version is an alternate version.

Install and unpack files

```
 sudo wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.6.tar.gz
 tar -xvf elasticsearch-1.7.6.tar.gz
 sudo rm elasticsearch-1.7.6.tar.gz
```

Run as a daemon

```
 elasticsearch-1.7.6/bin/elasticsearch -d
```

Test that the service is running

```
 curl 'http://localhost:9200/?pretty'
```

##### <span class="mw-headline" id="bkmrk-handling-crashes-1">Handling crashes</span>

ElasticSearch normally requires 1GB of memory, which is in the default memory configuation

```
 sudo nano /etc/elasticsearch/jvm.options
```

Set the maximum memory entry to a lower value

```
 -Xmx256m
```

Then restart the service

```
 sudo service elasticsearch restart
```

#### <span id="bkmrk--2"></span><span class="mw-headline" id="bkmrk-fixing%3A-%22curl%3A-%287%29-f-1">Fixing: "curl: (7) Failed to connect to localhost port 9200: Connection refused"</span>

In some cases the firewall needs to be configured

```
  sudo iptables -I INPUT -p tcp --dport 9200 --syn -j ACCEPT
  sudo iptables -I INPUT -p udp --dport 9200 -j ACCEPT
  sudo iptables-save
```

#### <span class="mw-headline" id="bkmrk-install-using-yum-in-1">Install using yum installer</span>

```
 sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
 sudo sh -c 'curl https://gist.githubusercontent.com/nl5887/b4a56bfd84501c2b2afb/raw/elasticsearch.repo >> /etc/yum.repos.d/elasticsearch.repo'
 sudo yum install -y elasticsearch
```

#### <span class="mw-headline" id="bkmrk-alternative%3A-install-1">Alternative: Install with RPM</span>

```
 wget <a class="external free" href="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.1-x86_64.rpm" rel="nofollow">https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.1-x86_64.rpm</a>
 wget <a class="external free" href="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.1-x86_64.rpm.sha512" rel="nofollow">https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.1-x86_64.rpm.sha512</a>
 shasum -a 512 -c elasticsearch-8.9.1-x86_64.rpm.sha512 
 sudo rpm --install elasticsearch-8.9.1-x86_64.rpm
 sudo rpm -e elasticsearch-8.9.1-x86_64.rpm
```

<span class="mw-headline" id="bkmrk--4"></span>