Jack Posted May 1, 2020 Share Posted May 1, 2020 (edited) 当你安装 LNMP一键安装包 或 宝塔面板,配置Nginx、MySQL/MariaDB、PHP之后 就来安装Elasticsearch ------------------------------------------------------------ 安装 Java Runtime 1.8 ------------------------------------------------------------ 命令 yum -y install java-1.8.0 命令 yum -y install java-1.8.0-openjdk-devel ------------------------------------------------------------ 安装 Elasticsearch ------------------------------------------------------------ 下载 rpm wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-x86_64.rpm 安装 rpm sudo rpm --install elasticsearch-7.6.2-x86_64.rpm 命令 sudo systemctl daemon-reload 命令 sudo systemctl enable elasticsearch.service 修改文件 vi /etc/elasticsearch/elasticsearch.yml #network.host: 192.168.0.1 修改为 network.host: 127.0.0.1 # http.port: 9200 修改为 http.port: 9200 保存并离开 :wq 修改文件 vi /etc/elasticsearch/jvm.options # Xms represents the initial size of total heap space # Xmx represents the maximum size of total heap space 会看到这两个,默认内存1GB -Xms1g -Xmx1g 修改为 (可调低) -Xms256m -Xmx256m 保存并离开 :wq 启动命令 sudo systemctl start elasticsearch.service 状态命令 service elasticsearch status 需要运行 Active: active (running) 测试Elasticsearch是否成功运行 curl http://127.0.0.1:9200 成功的话,会有讯息 You Know, for Search Edited December 6, 2022 by Jack Link to comment Share on other sites More sharing options...
Jack Posted January 31, 2021 Author Share Posted January 31, 2021 Elasticsearch的中文搜索,此处只是本地 localhost 使用 所以Elasticsearch使用的 9200 Port 不要外连 你最好再确保 大厂的WAF防火墙,若你开启 9200 Port,那就关闭 你云主机Linux的防火墙,若你开启 9200 Port,那就关闭 Link to comment Share on other sites More sharing options...
Jack Posted January 31, 2021 Author Share Posted January 31, 2021 (edited) 若你安装的elasticsearch版本太旧或太新,就要卸载,重新安装IPS论坛支持的elasticsearch版本 ------------------------------------------------------------- 卸载Elasticsearch命令 ------------------------------------------------------------- 这个卸载方法,限rpm安装的elasticsearch 查询命令 rpm -qa | grep elasticsearch 得知你安装 elasticsearch-7.10.2-1.x86_64 因为用rpm安装的elasticsearch,所以卸载也用rpm命令 rpm --erase elasticsearch-7.10.2-1.x86_64 删除目录,有文件要删掉 rm -f -r /etc/elasticsearch 删除目录,有文件要删掉 rm -f -r /var/lib/elasticsearch 重启 sudo reboot 回到上面的教程 安装Elasticsearch wget https://artifacts.elastic.co/downloads/elasticsearch/某版本.rpm 重新安装IPS论坛支持的elasticsearch版本 Edited January 31, 2021 by Jack Link to comment Share on other sites More sharing options...
Jack Posted April 5, 2021 Author Share Posted April 5, 2021 再来是设置论坛的Elasticsearch Elasticsearch设置完成,才能搜寻中文 [简体] Elasticsearch設置完成,才能搜尋中文 [繁體] Link to comment Share on other sites More sharing options...
二戒 Posted July 4, 2021 Share Posted July 4, 2021 -Xms256m -Xmx256m 这两行前面的空格务必删除,否则服务无法启动!!我已中招。 Link to comment Share on other sites More sharing options...
二戒 Posted July 4, 2021 Share Posted July 4, 2021 (edited) 7小時前,Jack說: ? ! 从论坛直接黏贴到SSH软件,真的前面自动有空格 我不是在这个论坛复制的,我前几个月的时候碰到这种错误,顺便提醒大家一下。 Edited July 4, 2021 by 二戒 Link to comment Share on other sites More sharing options...
Jack Posted July 16, 2021 Author Share Posted July 16, 2021 (edited) 这发生在独服 CentOS 64bit,安装elasticsearch-7.6.2-x86_64.rpm,在 启动命令/状态命令 就报错,于是我安装更旧的版本 启动命令 sudo systemctl start elasticsearch.service 状态命令 service elasticsearch status 下载 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.17.rpm 安装 sudo rpm --install elasticsearch-6.8.17.rpm 命令 sudo systemctl daemon-reload 命令 sudo systemctl enable elasticsearch.service 修改文件 vi /etc/elasticsearch/elasticsearch.yml #network.host: 192.168.0.1 修改为 network.host: 127.0.0.1 # http.port: 9200 修改为 http.port: 9200 :wq 保存并离开 修改文件 vi /etc/elasticsearch/jvm.options # Xms represents the initial size of total heap space # Xmx represents the maximum size of total heap space 会看到这两个,默认内存1GB -Xms1g -Xmx1g 修改为 -Xms256m -Xmx256m :wq 保存并离开 启动命令 sudo systemctl start elasticsearch.service 状态命令 service elasticsearch status 测试 Elasticsearch 是否安装成功 curl http://127.0.0.1:9200 成功的话,会有讯息,例如 You Know, for Search Edited July 24, 2021 by Jack Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now