linux系统安装elasticsearch搜索服务器
软件下载地址:https://pan.baidu.com/s/13gX0ParcOMO_XYcdfSPlzg 提取码:9y0e
安装的时候注意jdk和elasticsearch版本问题,本次测试版本:java 14,elasticsearch 7.6.0
elasticsearch安装需要依赖java环境,所以首先配置java环境变量: http://www.jiajiajia.club/blog/artical/yjw520/21
将elasticsearch的安装包上传到linux系统,我放在了 /usr/local 文件夹下。解压
进入elasticsearch的安装目录:/usr/local/elasticsearch-7.6.0/
执行运行命令:
./bin/elasticsearch
如果报错如下:
error:
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000600000000, 8589934592, 0) failed; error='Not enough space' (errno=12)
说明你服务器的内存不够,修改配置文件:
注意(下面所有的修改配置文件均在root用户下进行)
vim ./config/jvm.options
将相应的配置修改为如下(根据自己的服务器大小来):
-Xms512m
-Xmx512m
修改完成后再次启动报错:
uncaught exception in thread [main]
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349)
这是权限问题,elasticsearch不能再root用户下启动,所以需要添加es用户,赋予相应的权限,再es用户下启动。
添加es用户,用es用户启动
useradd es
passwd es
chown -R es:es /usr/local/elasticsearch-7.6.0
su es
./bin/elasticsearch
如果没问题的话,启动成功,在另一个连接终端下执行:curl -X GET http://localhost:9200,会出现如下代码:
{
"name" : "192.168.202.128",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "B-eVRGgOQFe7QgKgqHpQHA",
"version" : {
"number" : "7.6.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "7f634e9f44834fbc12724506cc1da681b0c3b1e3",
"build_date" : "2020-02-06T00:09:00.449973Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
解决外网不可访问问题:
前提是防火墙将 9200端口放开
修改配置文件:
vim ./config/elasticsearch.yml
末尾添加:
network.host: 0.0.0.0
修改上述配置文件后启动报错:
错误1
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
修改
vim /etc/security/limits.conf
#添加:
* soft nofile 65536
* hard nofile 65536
#此文件修改后需要重新登录
错误2
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改:
vim /etc/sysctl.conf
#末尾添加:
vm.max_map_count=655360
#保存执行如下命令:
sysctl -p
错误3
ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
修改:
vim ./config/elasticsearch.yml
追加:
cluster.initial_master_nodes: ["node-1"]
开放端口后外网访问:http://192.168.202.128:9200/
{
"name" : "192.168.202.128",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "B-eVRGgOQFe7QgKgqHpQHA",
"version" : {
"number" : "7.6.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "7f634e9f44834fbc12724506cc1da681b0c3b1e3",
"build_date" : "2020-02-06T00:09:00.449973Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
猜你喜欢
框架
1105
安装环境:系统:centos7java环境:jdk1.8版本:elasticsearch-7.3.2elasticsearch下载官网:https://www.elastic.co/cn
blog
linux系统安装apache服务器
其他
3554
1.卸载apache服务器查看有没有安装过:yumlist|grephttpd停止服务:systemctlstophttpd.service卸载httpd:yumerase
linux系统
1210
软件版本:一、linux系统版本:CentOS-7-x86_64-DVD-1708.iso下载地址:http://mirror.nsc.liu.se/centos-store/7.4.1708
weblog
671
安装环境系统:centos7rabbitmq:rabbitmq-server-3.6.10-1.el7.noarch.rpm安装socatyum-yinstallsocat安装
weblog
758
centos7版本部署的tomcat服务器,需要将8080端口放开执行如下命令:firewall-cmd--zone=public--add-port=8080/tcp--permanentfirewall
linux
538
/rabbitmq/erlang-rpm/releases,我下载的版本是23.3.4.6上传到服务器上执行安装命令:rpm-ivherlang-23.3.4.6-1.el7.x86_64.rpm二、安装
blog
linux系统yum安装mysql
linux系统
2606
linux系统yum安装mysql1.下载并安装MySQL官方的YumRepository[root@localhost/]#wget-i-chttp://dev.mysql.com/get
file
apache服务器安装教程
apache服务器安装教程 linux
620
1.卸载apache服务器查看有没有安装过yumlist|grephttpd停止服务:systemctlstophttpd.service卸载httpd:yumerase
归档
2018年11月
12
2018年12月
33
2019年01月
28
2019年02月
28
2019年03月
32
2019年04月
27
2019年05月
33
2019年06月
6
2019年07月
12
2019年08月
12
2019年09月
21
2019年10月
8
2019年11月
15
2019年12月
25
2020年01月
9
2020年02月
5
2020年03月
16
2020年04月
4
2020年06月
1
2020年07月
7
2020年08月
13
2020年09月
9
2020年10月
5
2020年12月
3
2021年01月
1
2021年02月
5
2021年03月
7
2021年04月
4
2021年05月
4
2021年06月
1
2021年07月
7
2021年08月
2
2021年09月
8
2021年10月
9
2021年11月
16
2021年12月
14
2022年01月
7
2022年05月
1
2022年08月
3
2022年09月
2
2022年10月
2
2022年12月
5
2023年01月
3
标签
算法基础
linux
前端
c++
数据结构
框架
数据库
计算机基础
储备知识
java基础
ASM
其他
深入理解java虚拟机
nginx
git
消息中间件
搜索
maven
redis
docker
dubbo
vue
导入导出
软件使用
idea插件
协议
无聊的知识
jenkins
springboot
mqtt协议
keepalived
minio
mysql
ensp
网络基础
xxl-job
rabbitmq
haproxy
目录
没有一个冬天不可逾越,没有一个春天不会来临。最慢的步伐不是跬步,而是徘徊,最快的脚步不是冲刺,而是坚持。