- Compatible XF Versions
- 1.4
- 1.5
- Additional Requirements
- CentOS 6 64 bits with cPanel 56.0.17
This tutorial will help you to setup Elasticsearch on Red Hat/CentOS 6 64 bits based distribution.
1. Verify Java
Java is the primary requirement for installing Elasticsearch. So make sure you have Java installed on your system.
1. Verify Java
Java is the primary requirement for installing Elasticsearch. So make sure you have Java installed on your system.
PHP:
This tutorial will help you to setup Elasticsearch on Red Hat/CentOS 6 64 bits based distribution.
1. Verify Java
Java is the primary requirement for installing Elasticsearch. So make sure you have Java installed on your system.
PHP:
# java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
If you don’t have Java installed on your system, use one of following code to install it first.
Install Java Runtime 1.8
PHP:
# sudo yum install java-1.8.0
or if you need a java compiler and other developer tools:
PHP:
# sudo yum install java-1.8.0-openjdk-devel
Then use the alternatives command to make Java 1.8 the default.
PHP:
# sudo /usr/sbin/alternatives --config java
2. Download Elasticsearch
YUM / DNF
Download and install the public signing key:
PHP:
# rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
Add the following in your /etc/yum.repos.d/ directory in a file with a .repo suffix, for example elasticsearch.repo
PHP:
[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=https://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
And your repository is ready for use. You can install it with:
PHP:
# yum install elasticsearch
Configure Elasticsearch to automatically start during bootup. If your distribution is using SysV init (check with ps -p 1), then you will need to run:
PHP:
# chkconfig --add elasticsearch
Your search engine is now functional.
Configuration Settings:
We did some major cleanup on all configuration files, while keeping everything documented for easy reference to any settings you need to adjust. The files allowing you to tweak Elasticsearch are:
/etc/elasticsearch/elasticsearch.yml
/etc/elasticsearch/logging.yml
/etc/security/limits.d/60-elasticsearch.conf
/etc/sysconfig/elasticsearch
Out of the box, everything is optimized to recommended Elasticsearch values. For improved security, set the service bind address to a specific IP (i.e. localhost):
Open up /elasticsearch/config/elasticsearch.yml and on line 199 edit
# network.host: 192.168.0.1
to
network.host: 127.0.0.1
On line 211 edit
# http.port: 9200
to
http.port: 9200
cluster.name: YourIndexName|' /etc/elasticsearch/elasticsearch.yml
Save and Exit
XenForo Settings:
Install the Enhanced Search add-on and set your preferred index name, in Search Options. The default value is your database name.
Start the service:
# sudo service elasticsearch start
# sudo service elasticsearch restart
Test if it works:
# sudo service elasticsearch status
# curl http://127.0.0.1:9200
If you are ConfigServer Security & Firewall - CSF user? Allow incoming TCP ports 9200,9300 on you IPv4 Port Settings.
Add this line exe:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre/bin/java to your /etc/csf/csf.pignore files.
Upgrading | Elasticsearch:
PHP:
# yum update
Uninstall elsticsearch on centOS
Code:
# yum remove elasticsearch