XenForo Enhanced Search depends on ElasticSearch 2.0+. Installing and configuring ElasticSearch to work with XF can be a hassle, so I've created a short guide to install it on CentOS 7. With some modifications, the guide should probably work on other versions of CentOS/Fedora/Redhat and derivative distribution.
All commands assume that you are root or that you run commands with sudo.
Let's add the ElasticSearch yum-repository so that you can easily get updates and bug fixes via
First, install the ElasticSearch GPG key:
Then create a yum repository for ElasticSearch 7:
Then run the installation:
By default on CentOS 7, SELinux runs in enforcing mode. Therefore, we need to tell SELinux that the web server (Apache, Nginx, etc.) should be allowed to talk to ElasticSearch over TCP:
It's good practice to create a password for ElasticSearch, so let's do this: you'll be prompted for passwords for 4 or so users. Write down these passwords! You will need the
We configure the domain to work only on the local host. Add (or edit) the
The last step is to set up ElasticSearch to start on server boot and also to start it right now:
You can now verify that ElasticSearch is up and running as expected with the command:
...which should produce output similar to this (except that the version number is 7):
See also:
All commands assume that you are root or that you run commands with sudo.
Let's add the ElasticSearch yum-repository so that you can easily get updates and bug fixes via
yum update
.First, install the ElasticSearch GPG key:
Bash:
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Bash:
cat > /etc/yum.repos.d/elasticsearch.repo <<EOF
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF
Code:
yum install elasticsearch
Bash:
setsebool httpd_can_network_connect on -P
elastic
user password when setting up advanced search in the XenForo control panel.
Bash:
echo "xpack.security.enabled: true" > /etc/elasticsearch/elasticsearch.yml
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive
network.host
parameter in the /etc/elasticsearch/elasticsearch.yml
file:
Bash:
network.host: 127.0.0.1
Bash:
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service
Bash:
curl -u elastic -X GET "localhost:9200/?pretty"
Code:
{
"name" : "Cp8oag6",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA",
"version" : {
"number" : "6.8.10",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "f27399d",
"build_date" : "2016-03-30T09:51:41.449Z",
"build_snapshot" : false,
"lucene_version" : "7.7.3",
"minimum_wire_compatibility_version" : "1.2.3",
"minimum_index_compatibility_version" : "1.2.3"
},
"tagline" : "You Know, for Search"
}
See also: