XenForo Enhanced Search eklentisi, varsayılan MySQL fulltext aramasının yerine Elasticsearch'i kullanır ve büyük forumlarda arama hızını ile alaka kalitesini dramatik biçimde iyileştirir. AIOR olarak community.aior.com forumumuzda Elasticsearch 8 + XenForo 2.3 kombinasyonunu çalıştırıyoruz. Bu yazıda kurulum, yapılandırma ve bakım adımlarını derliyoruz.
1) Elasticsearch 8 kurulumu
AlmaLinux 8 üzerinde Elastic'in resmi RPM deposundan kurulum:
Code:
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
cat > /etc/yum.repos.d/elastic.repo <<EOF
[elasticsearch-8.x]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
EOF
dnf install -y elasticsearch
Code:
systemctl enable --now elasticsearch
2) Java sürümü kontrolü
Elasticsearch 8, paket içinde JDK 17 ile gelir, yani ayrıca Java kurmanıza gerek yoktur. Sistemde başka Java sürümü varsa karışmaması için /etc/elasticsearch/jvm.options.d/ altına özelleştirilmiş ayar eklenebilir.
3) Güvenlik yapılandırması
Elasticsearch 8 varsayılan olarak xpack.security'i etkin başlatır. Kurulum tamamlandığında konsolda otomatik bir elastic kullanıcısı şifresi gösterilir. Bu şifreyi kaydedin. Şifreyi sonra sıfırlamak için:
Code:
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
4) Erişim sınırlama
Elasticsearch'ün dış dünyaya açılmasını önlemek için /etc/elasticsearch/elasticsearch.yml dosyasında:
Code:
network.host: 127.0.0.1
http.port: 9200
5) XenForo eklenti kurulumu
XenForo Admin Panel > Add-ons > Search & Browse > XenForo Enhanced Search satın aldıktan sonra arşivi indirin ve panel üzerinden install edin. Admin > Options > Search içinde Search source = Elasticsearch seçin.
6) Bağlantı yapılandırması
Admin > Options > Elasticsearch:
- Server: 127.0.0.1
- Port: 9200
- Index name: aior_forum
- Username: elastic
- Password: kurulumdan kopyalanan şifre
- Verify SSL: TLS sertifikasını kabul etmek için CA fingerprint'i ekleyin
7) İlk indexleme
Admin > Tools > Rebuild Caches > Search Index. Forum büyüklüğüne göre 5 dakikadan 1 saate kadar sürebilir. CLI alternatif:
Code:
cd /home/aior/public_html/community
php cmd.php xf-rebuild:search-index
8) Bellek ayarları
Elasticsearch heap, varsayılan 1 GB'tır. Forum 100 binin üzerinde post içeriyorsa heap'ı 4-8 GB'a çıkarın:
Code:
/etc/elasticsearch/jvm.options.d/heap.options:
-Xms4g
-Xmx4g
9) Bakım
- Index hatalarında: Admin > Tools > Rebuild Search Index.
- Disk dolması: Elasticsearch index'i /var/lib/elasticsearch/ altında; bu hacmin SSD'de tutulması performans için kritiktir.
- Log dosyaları /var/log/elasticsearch/ altında; rotation logrotate ile otomatik.
10) Yedekleme
Elasticsearch snapshot API ile yedek alınır. Forum'un MySQL veritabanı ana doğruluk kaynağıdır; arama indexi her zaman yeniden inşa edilebilir, ancak yine de periyodik snapshot iyi bir alışkanlıktır.
XenForo Enhanced Search replaces the default MySQL fulltext engine with Elasticsearch and dramatically improves both speed and relevance on large forums. At AIOR we run Elasticsearch 8 plus XenForo 2.3 on community.aior.com. This guide walks through installation, configuration and ongoing maintenance.
1) Installing Elasticsearch 8
On AlmaLinux 8, install from Elastic's official RPM repository:
Code:
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
cat > /etc/yum.repos.d/elastic.repo <<EOF
[elasticsearch-8.x]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
EOF
dnf install -y elasticsearch
Code:
systemctl enable --now elasticsearch
2) Java version
Elasticsearch 8 ships with bundled JDK 17, so no separate Java installation is required. If another Java is present, isolate Elasticsearch's runtime by adding /etc/elasticsearch/jvm.options.d/ overrides.
3) Security setup
Elasticsearch 8 starts with xpack.security enabled by default. On first start the installer prints an auto-generated elastic user password — capture it. To reset later:
Code:
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
4) Restricting access
Keep Elasticsearch off the public network. In /etc/elasticsearch/elasticsearch.yml:
Code:
network.host: 127.0.0.1
http.port: 9200
5) XenForo add-on installation
Purchase XenForo Enhanced Search from XenForo > Add-ons > Search & Browse. Upload via the admin panel and switch Admin > Options > Search > Search source to Elasticsearch.
6) Connection configuration
Admin > Options > Elasticsearch:
- Server: 127.0.0.1
- Port: 9200
- Index name: aior_forum
- Username: elastic
- Password: from the install output
- Verify SSL: paste the CA fingerprint
7) Initial indexing
Admin > Tools > Rebuild Caches > Search Index. Depending on forum size it takes 5 minutes to an hour. The CLI alternative is more reliable for large forums:
Code:
cd /home/aior/public_html/community
php cmd.php xf-rebuild:search-index
8) Memory tuning
The default JVM heap is 1 GB. If the forum exceeds 100k posts, raise it to 4-8 GB:
Code:
/etc/elasticsearch/jvm.options.d/heap.options:
-Xms4g
-Xmx4g
9) Maintenance
- Index drift → Admin > Tools > Rebuild Search Index.
- Disk pressure → indices live under /var/lib/elasticsearch/; keep this on SSD for query latency.
- Logs under /var/log/elasticsearch/; rotated automatically via logrotate.
10) Backups
Use the Elasticsearch snapshot API for full-cluster backups. The MySQL database remains the source of truth — the search index can always be rebuilt — but periodic snapshots are a sensible habit for big forums.