当前位置: 代码网 > it编程>数据库>MsSqlserver > ES集成到ambari中出现的常见问题归总

ES集成到ambari中出现的常见问题归总

2024年08月01日 MsSqlserver 我要评论
需要修改ambari-server资源中的一个配置参数,将gnore_groupsusers_create由false改为true,编辑elasticsearch-config.xml,发现其中的discovery.zen.ping.unicast.hosts属性的值是空的。修改/etc/security/limits.conf文件,增加配置(所有master和slave节点)。修改/etc/sysctl.conf文件,增加配置(所有master和slave节点)。查看日志会发现提示这两个错误。

1.elasticesearch用户名组的问题

keyerror: u'elasticsearch'
error: error: unable to run the custom hook script ['/usr/bin/python', '/var/lib/ambari-agent/cache/stack-hooks/before-any/scripts/hook.py', 'any', '/var/lib/ambari-agent/data/command-102.json', '/var/lib/ambari-agent/cache/stack-hooks/before-any', '/var/lib/ambari-agent/data/structured-out-102.json', 'info', '/var/lib/ambari-agent/tmp', 'protocol_tlsv1_2', '']

解决办法:

        需要修改ambari-server资源中的一个配置参数,将gnore_groupsusers_create由false改为true,之后手动创建用户和用户组

python /var/lib/ambari-server/resources/scripts/configs.py -u admin -p admin -n [cluster_name] -l [cluster_fqdn] -t 8080 -a set -c cluster-env -k ignore_groupsusers_create -v true

cluster_name:ambari安装的项目名称;

cluster_fqdn:服务器名称

记得结合实际情况修改

#查看用户管理配置

python /var/lib/ambari-server/resources/scripts/configs.py -u admin -p admin -n bigdata -l master -t 8001 -a get -c cluster-env |grep -i ignore_groupsusers_create

"ignore_groupsusers_create": "false",

#修改用户管理配置

python /var/lib/ambari-server/resources/scripts/configs.py -u admin -p admin -n bigdata -l master -t 8001 -a set -c cluster-env -k ignore_groupsusers_create -v true

2.创建es用户并关联到组

cat /etc/group |grep -i elasticsearch  
cat /etc/group |grep -i kibana
cat /etc/passwd |grep -i elasticsearch
cat /etc/passwd |grep -i kibana 

先查看组和用户是否存在,一般出问题是因为组存在,但用户不存在;

useradd -g elasticsearch elasticsearch

useradd -g kibana kibana

添加用户即可;

3.elasticsearch无法导入format_hdp_stack_version

importerror: cannot import name format_hdp_stack_version

第一步:

#cd /var/lib/ambari-server/resources/stacks/hdp/3.0/services/elasticsearch/package/scripts
#vim params.py
#rm -rf /var/lib/ambari-agent/cache/*

第二部:kibana无法导入format_hdp_stack_version

#cd /var/lib/ambari-server/resources/stacks/hdp/3.0/services/kibana/package/scripts
#vim params.py
#ambari-server restart

两步修改完成后,重启ambari-server 

4.hostname was not found in configuration dictionary

"/var/lib/ambari-agent/cache/stacks/hdp/3.0/services/elasticsearch/package/templates/elasticsearch.master.yml.j2", line 93, in top-level template code
action.destructive_requires_name: {{action_destructive_requires_name}}
file "/usr/lib/ambari-agent/lib/resource_management/libraries/script/config_dictionary.py", line 73, in __getattr__
raise fail("configuration parameter '" + self.name + "' was not found in configurations dictionary!")
resource_management.core.exceptions.fail: configuration parameter 'hostname' was not found in configurations dictionary!

 解决办法:

#cd /var/lib/ambari-server/resources/stacks/hdp/3.0/services/elasticsearch/configuration

 编辑elasticsearch-config.xml,发现其中的discovery.zen.ping.unicast.hosts属性的值是空的。

我们在安装的时候是填了这个参数的,将这个参数的值给补上。

<name>discovery.zen.ping.unicast.hosts</name>
<value>master</value>

cd

/var/lib/ambari-server/resources/stacks/hdp/3.0/services/elasticsearch/package/scripts
编辑params.py,发现其中有两处hostname=config[‘hostname’]的写法。

将两处都修改为:

hostname = config['configurations']['elasticsearch-config']['discovery.zen.ping.unicast.hosts'] 

清除所有elasticsearch slave节点的ambari-agent缓存。
server节点重启ambari-server restart
slave节点重启ambari-agent restart
重启elasticsearch服务,发现服务可以启动了

master和slave启动又停止

 

查看日志会发现提示这两个错误。

错误提示:

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
解决办法:
每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量

ulimit -hn
ulimit -sn

修改/etc/security/limits.conf文件,增加配置(所有master和slave节点)。

错误提示:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决办法:
修改/etc/sysctl.conf文件,增加配置(所有master和slave节点)。

vm.max_map_count=262144

然后执行命令sysctl -p生效

sysctl -p

 

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com