elastisearch 安裝

一、安裝elasticsearch-rtf

1.jdk 1.8 安裝教程 :https://blog.csdn.net/weixin_36634753/article/details/101079873

2.下載elastisearch-rtf 加了中文搜索:https://github.com/TBirdsWR/elasticsearch-rtf (最好下載zip包)

3.上傳服務器上解壓 解壓命令:unzip 包名

4.修改權限 chmod -R 755 包名

5.新建用戶 用戶組

 groupadd es
    useradd es -g es -p es
    chown -R es:es es/elasticsearch-rtf
    su es

6.修改屬主chown -R  用戶名:用戶組 包名 (不能是root,因爲elasticsearch啓動不能用root用戶)

7.如果內存不大,要修改config/jvm.options內存大小,512m

8.在root用戶,編輯/etc/security/limits.conf添加類似如下內容

    ~ vim /etc/security/limits.conf
    修改內容:* soft nofile 65536

9.然後重新登錄一下用戶輸入ulimit -Hn

10.在切回root用戶  vim /etc/sysctl.conf 在最後面添加

  
     vm.max_map_count=262144
     

11. 查看是否修改成功sysctl -a|grep vm.max_map_count

12.修改外網訪問權限 在/config/elasticsearch.yml添加下面配置

network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE
http.cors.allow-headers: "X-Requested-With,Content-Type,Content-Length, X-User"

13.到bin下啓動

14.訪問上面紅框裏的地址(記得要添加端口號)

二、安裝elasticsearch-head

1.下載搜索界面 https://github.com/TBirdsWR/elasticsearch-head

2.unzip 解壓

需要使用node 先安裝node

安裝node教程https://blog.csdn.net/weixin_36634753/article/details/101079873

3.

然後切回剛纔下載的elasticsearch-head 目錄執行

npm install
npm run start

4.訪問地址

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章