概述
1、安装步骤
1.1ElasticSearch2.x版本以后,es必须只能安装在非root用户下面;
1.2上传elasticSearch压缩包后并解压;
1.3修改$ELASTICSEARCH_HOME/conf/elasticsearch.yml文件
cluster.name: elasticSearch-test
node.name: hadoop01
path.data: /home/hadoop/data/elastic
path.logs: /home/hadoop/data/logs/elastic
network.host: 0.0.0.0
http.port: 9200
说明:
cluster.name:高可用ElasticSearch分布式集群名字随意;
node.name:每台机器不能一样;
path.data、path.logs的目录需要手动创建目录,否则会报错;
network.host:配置成0.0.0.0是随处可以访问;
http.port:网页访问端口。
1.4启动
bin/elasticsearch
二、报错及解决办法
1、内核版本相关错误
[hadoop] unable to install syscall filter: java.lang.UnsupportedOperationException:
seccomp unavailable: CONFIG_SECCOMP not compiled into kernel,
CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
内核不匹配,因为当前版本过低导致!
有两种解决方案:
1)直接使用CentOS7.x
2)升级内核kernel
祥参:https://blog.csdn.net/moshang_3377/article/details/96349646
2、max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
解决方案:
修改/etc/security/limits.conf添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
3、max number of threads [1024] for user [bigdata] is too low, increase to at least [4096]
解决办法:
进入/etc/security/limits.d/目录下修改配置文件90-nproc.conf
sudo vim /etc/security/limits.d/90-nproc.conf
将原先的
* soft nproc 1024
改为
* soft nproc 4096
4、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决办法:
修改配置文件/etc/sysctl.conf
添加如下内容:vm.max_map_count = 262144
5、system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
解决办法:
在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
?:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
注意: 在其他机器中都要做相关的配置和修改!
将配置完的文件拷贝至其他两台:
scp -r elasticsearch-6.5.2 hadoop@hadoop02:/home/hadoop/apps
scp -r elasticsearch-6.5.2 hadoop@hadoop03:/home/hadoop/apps
三、分布式集群安装
node.name: 做相关更改意外,添加如下配置
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["hadoop01", "hadoop02", "hadoop03"]
四、启动验证
注意:
有几台就需要启动几台机器,没办法一键启动多台~
因为一直前台运行不是我们想要的,所以咱们还是应该在后台运行程序,使用bin/elasticsearch --help 命令查看一下有没有相关命令,然后看见参数-d正是我们所需要的
每一台机器上执行:
bin/elasticsearch -d
然后jps可以查看ElasticSearch的进程
1、控制台
curl -XGET http://localhost:9200
2、浏览器
http://bigdata01:9200/
出现如下信息说明,安装配置成功!
{
name: "hadoop01",
cluster_name: "elasticSearch-test",
cluster_uuid: "KQtUhSTRR7O6MfNk0EIy4A",
version: {
number: "6.5.2",
build_flavor: "default",
build_type: "tar",
build_hash: "9434bed",
build_date: "2018-11-29T23:58:20.891072Z",
build_snapshot: false,
lucene_version: "7.5.0",
minimum_wire_compatibility_version: "5.6.0",
minimum_index_compatibility_version: "5.0.0"
},
tagline: "You Know, for Search"
}
五、如果启动ElasticSearch进程后某个节点被莫名其妙被kill且日志无报错的解决办法
修改ES中config目录下的jvm.options文件
vim /home/hadoop/apps/elasticsearch-6.5.2/config/jvm.options
将
-Xms1g
-Xmx1g
改为
-Xms512m
-Xmx512m
重新启动就成功了~
最后
以上就是听话小虾米为你收集整理的ElasticSearch分布式安装及遇到问题的解决办法1、安装步骤二、报错及解决办法三、分布式集群安装四、启动验证五、如果启动ElasticSearch进程后某个节点被莫名其妙被kill且日志无报错的解决办法的全部内容,希望文章能够帮你解决ElasticSearch分布式安装及遇到问题的解决办法1、安装步骤二、报错及解决办法三、分布式集群安装四、启动验证五、如果启动ElasticSearch进程后某个节点被莫名其妙被kill且日志无报错的解决办法所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复