• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Admin

Well-Known Member
Staff member
Administrator
Xenforo Enhanced Search depends on ElasticSearch 2.0+. Installing and configuring ElasticSearch so it works with XF might be a challenge, so I have put together some quick instructions for installing it on CentOS 7. With some tweaks the instructions should probably work on other versions of CentOS/Fedora/Redhat and derived distros as well.

All the commands assume you are the root user or that you run the instructions with sudo.

We'll install the ElasticSearch yum repo so that you can easily get patch/bugfix updates with "yum update".

First install the ElasticSearch GPG key:
Bash:
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Then create the yum repo file for ElasticSearch 7:
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
Then do the actual installation:
Bash:
yum install elasticsearch
By default on CentOS 7, SELinux is running in enforcing mode. So we need to tell SELinux that the web server (Apache, Nginx or something else) should be allowed to talk to ElasticSearch over TCP:
Bash:
setsebool httpd_can_network_connect on -P
We'll now make some config changes to the main ElasticSearch config file. We want a name for the cluster, and we'll set the host, TCP port and enable the security settings so we can later set passwords.
Bash:
cat > /etc/elasticsearch/elasticsearch.yml <<EOF
cluster.name: elasticxf
network.host: 127.0.0.1
http.port: 9200
xpack.security.enabled: true
EOF
Start ElasticSearch - this might take a few seconds:
Bash:
systemctl start elasticsearch.service
It's good practice to create a password for ElasticSearch, and there are plenty of examples of ElasticSearch instances that were hacked because they didn't create passwords. (It's also a good idea have a firewall and not to open the ElasticSearch port to the Internet!) So let's create those passwords now - you'll be prompted to type in passwords for 7 or so users. Make sure to note down these passwords! You'll need the 'elastic' user and password when you configure Enhanced Search in the XF admin CP.
Bash:
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive
The final installation step is to configure ElasticSearch to start whenever the machine boots up:
Bash:
systemctl daemon-reload
systemctl enable elasticsearch.service
Now you can verify that ElasticSearch is up and running as expected with:
Bash:
curl -u elastic -X GET "localhost:9200/?pretty"
... which should give output similar to this:
Bash:
{
"name" : "localhost.localdomain",
"cluster_name" : "elasticxf",
"cluster_uuid" : "sSvt41vAS8i6Z1RRFI5V4w",
"version" : {
"number" : "7.8.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "757314695644ea9a1dc2fecd26d1a43856725e65",
"build_date" : "2020-06-14T19:35:50.234439Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top