跳轉到內容
View in the app

A better way to browse. Learn more.

PHP論壇人

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

安裝 Elasticsearch 8.17 搜尋中文 (Invision Community 5.0.5 開始改用新版本)

精選回覆

發表於

安裝 Elasticsearch 8.17 搜尋中文 (Invision Community 5.0.5 開始改用新版本)

------------------------------------------------------------
安裝套件、依賴包
------------------------------------------------------------

安裝java
apt install -y default-jdk



已安裝 openjdk version "17.0.14" 2025-01-21
java -version




------------------------------------------------------------
安裝 Elasticsearch
------------------------------------------------------------


官網 歷史版本
https://www.elastic.co/downloads/past-releases/


因為論壇後端有寫,Invision Community 5.0.5 至少執行 Elasticsearch 8.0 ~ 9.0版本


下載elasticsearch-8.17.4-amd64.deb
wget  https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.17.4-amd64.deb



dpkg -i elasticsearch-8.17.4-amd64.deb


systemctl daemon-reload


systemctl enable elasticsearch.service


systemctl start elasticsearch.service


---------------------------------------
查詢RAM占用情況
---------------------------------------

free -h

1.我的VPS是 4C/8G RAM
Mem:  5G used (elasticsearch已占用5GB RAM)

2.VPS是 2C/2G RAM
Mem:  1.8G used



---------------------------------------
修改 elasticsearch.yml
---------------------------------------

vi /etc/elasticsearch/elasticsearch.yml


#network.host: 192.168.0.1
修改為
network.host: 127.0.0.1



# http.port: 9200
修改為
http.port: 9200



新版本elasticsearch還要修改這裡的 true 改為 false

搜尋
xpack.security.enabled: true
改為
xpack.security.enabled: false




ESC儲存並離開
:wq






-------------------------------------------------------------
這個elasticsearch版本,要來jvm.options.d目錄底下修改
-------------------------------------------------------------

檔名需要 .options 結尾

vi /etc/elasticsearch/jvm.options.d/RAM.options

因為只是小論壇用量不大,就越低越好

-Xms256m
-Xmx256m




ESC儲存並離開
:wq





---------------------------------------
啟動
---------------------------------------

啟動
systemctl start elasticsearch.service


瀏覽狀態
service elasticsearch status



測試 Elasticsearch 是否安裝成功
返回 curl: (52) Empty reply from server
curl http://127.0.0.1:9200









重開機
reboot



再測一次,測試 Elasticsearch 是否在執行
service elasticsearch status



curl http://127.0.0.1:9200

成功的話,會有訊息,例如 You Know, for Search



---------------------------------------
查詢RAM占用情況
---------------------------------------

free -h

1.我的VPS是 4C/8G RAM
Mem:  1.x G used (elasticsearch已占用1GB RAM)

2.VPS是 2C/2G RAM
Mem:  1.2 G used





---------------------------------------
移除elasticsearch
---------------------------------------

dpkg -r elasticsearch


重開機
reboot


回到上面的教學,再次安裝Elasticsearch其他版本

本文章最後於,由Jack編輯

建立帳號或登入後發表意見

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.