• 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.

ElasticSearch 7 on CentOS

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

Thread starter Similar threads Forum Replies Date
Admin ElasticSearch Essentials xenforo 2 Xenforo 2.x Premium 0
Admin Hướng dẫn cấu hình Nginx và php-fpm để dùng socket trên CentOS 6 đơn giản VPS & Dedicated Server 0
Admin Hướng dẫn ẩn phiên bản Nginx và Apache trên Centos 6 VPS & Dedicated Server 0
Admin Hướng dẫn cài php 5.6 và các phiên bản php trên CentOS 6, CentOS 7 đơn giản VPS & Dedicated Server 0
Admin Hướng dẫn đổi port trên VPS CentOS 6.8 VPS & Dedicated Server 0
Admin Hướng dẫn cài mod_evasive chống DDoS cho Apache trên CentOS 7 VPS & Dedicated Server 0
Admin Hướng dẫn cài đặt OpenVPN trên CentOS 6.8 chi tiết VPS & Dedicated Server 1
Admin Hướng dẫn nâng cấp php 5.6 cho CentOS 6.x chi tiết bằng hình ảnh VPS & Dedicated Server 1
Admin Hướng dẫn xác minh 2 bước SSH trên CentOS chi tiết bằng hình ảnh VPS & Dedicated Server 0
Admin Hướng dẫn cài Kloxo-MR 7 trên CentOS 6.5 chi tiết bằng hình ảnh VPS & Dedicated Server 0
Admin Hướng dẫn thêm thành viên vào OpenVPN trên CentOS 7 chi tiết VPS & Dedicated Server 7
Admin Hướng dẫn cài đặt OpenVPN trên CentOS 7.0 chi tiết VPS & Dedicated Server 45
Admin Hướng dẫn cài đặt Linux, nginx, MySQL, PHP (LEMP) trên CentOS 7.0 chi tiết VPS & Dedicated Server 1
Admin Hướng dẫn cài đặt tự động Nginx, PHP-FPM, MySQL và phpMyAdmin trên CentOS đơn giản VPS & Dedicated Server 1
Admin Hướng dẫn cài đặt zPanel trên CentOS - Install zPanel on CentOS VPS & Dedicated Server 0
Admin Hướng dẫn cài đặt Percona XtraDB Cluster trên CentOS VPS & Dedicated Server 1
Admin Hướng dẫn cài đặt kloxo trên vps linux centos VPS & Dedicated Server 0
Admin Hướng dẫn cài đặt Apache, MySQL, PHP trên CentOS 5.2 VPS & Dedicated Server 0
Admin [Centos] centmin mod cài đặt nginx + php-fpm + mariadb 5.5.32 mysql VPS & Dedicated Server 0
Admin Hướng dẫn cài đặt Apache, PHP, MySQL, và phpMyAdmin trên CentOS VPS & Dedicated Server 0
Admin Hướng dẫn cài memcached trên server Linux (Centos 5) VPS & Dedicated Server 0
Admin Hướng dẫn cài đặt Apache, PHP, MySQL, và phpMyAdmin trên CentOS VPS & Dedicated Server 0
Admin Cài đặt Tích hợp XCache vào PHP5 trên CentOS 5.x 6.x VPS & Dedicated Server 0
Admin Hướng dẫn cài đặt CentOS 5.5 i386cho VPS Sakura Hosting / Domain 0
Similar threads
























New posts New threads New resources

Top