您的位置:首页 > 运维架构

elasticsearch2.2-yarn(hadoop)安装

2016-03-01 11:30 375 查看
  序言: 首先说说es2.2在yarn上跑的好处和不足,在hadoop上跑可以统一使用yarn资源,不用单独给es搞物理机了。这里要注意es并没有使用hdfs,网上资料说可以使用hdfs来管理es备份文件,本人费很大劲没有找到成功安装方式。 参考网址:https://github.com/elastic/elasticsearch-hadoop 源码地址https://www.elastic.co/guide/en/elasticsearch/hadoop/current/es-yarn.html 官方文档https://www.elastic.co/downloads/elasticsearch   下载包地址安装需要:这里需要一个jar(elasticsearch-yarn-2.2.0.jar)和一个zip(elasticsearch-2.2.0.zip)jar从私服下载,zip从官网下载就可以了开始安装:1.使用hadoop运行jar输出帮助文档 $ hadoop jar elasticsearch-yarn-2.2.0.jarNo command specifiedUsage:-download-es : Downloads Elasticsearch.zip-install : Installs/Provisions Elasticsearch-YARN into HDFS-install-es : Installs/Provisions Elasticsearch into HDFS-start : Starts provisioned Elasticsearch in YARN-status : Reports status of Elasticsearch in YARN-stop : Stops Elasticsearch in YARN-help : Prints this helpConfiguration options can be specified _after_ each command; see the documentation for more information.2.按照官网执行 $hadoop jar elasticsearch-yarn-2.2.0-download-es下载了n次不行啊,看看原来没地址吧 https://download.elastic.co/elasticsearch/elasticsearch/  试了试好像下载不了自己找地址手工下载吧  https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.2.0/elasticsearch-2.2.0.zip 放在hadoop的app/downloads 中吧,为什么放这里的,因为官方文档说从命令行执行的  .downloads中获取zip这样就算下载完了。 下一步安装命令:hadoop jar elasticsearch-yarn-2.2.0.jar-install-es hadoop jar elasticsearch-yarn-2.2.0.jar -install不错,两个执行都上传成功了文件放在了 hdfs://cluster1:8020/apps/elasticsearch/ 目录下启动一下试一试吧:hadoopjar /app/elasticsearch-hadoop-2.2.0/dist/elasticsearch-yarn-2.2.0.jar -start 提示 16/02/18 09:37:24 INFO impl.YarnClientImpl: Submitted application application_1455675371242_0002Launched a 1 node Elasticsearch-YARN cluster [application_1455675371242_0002@http://host218:9026/proxy/application_1455675371242_0002/] at Thu Feb 18 09:37:23 CST 2016查看一下状态:hadoopjar elasticsearch-yarn-2.2.0.jar -status提示如下Id State Status Start Time Finish Time Tracking URLapplication_1455675371242_0002 FINISHED FAILED 2/18/16 9:37 AM 2/18/16 9:37 AM http://host218:9026/proxy/ap 官网提示应该是这样Id State Status Start Time Finish Time Tracking URLapplication_1415921358606_0007 RUNNING UNDEFINED 11/14/14 19:34 PM N/A 这里使用yarn命令查看一下日志发现,是root权限不让启动,这样我们就使用一个参数强制使用root启动吧。命令如下:hadoop jar elasticsearch-yarn-2.2.0.jar -start sys.prop.es.insecure.allow.root=true containers=5
解释一下啊,第一个参数是允许root启动(其他参数参考官网),第二个参数是使用多少个datanode节点。终于启动成功可以正常使用过了。这里说一下,这个zip可以减压修改配置文件,也可以安装head等插件。以下是一些优化及其配置供参考:#node名称为主机名称
node.name: ${HOSTNAME}
使用eth0网卡
network.host: _eth0_
单播发现nodes集合
discovery.zen.ping.unicast.hosts: ["host213", "host217", "host221", "host231","host236","host233","host235"]
cluster.name: ehl_elasticsearchpath.data: /data/elasticsearch/indexdatapath.work: /data/elasticsearch/workpath.logs: /data/elasticsearch/logs
#允许锁定内存bootstrap.mlockall: trueES_MIN_MEM: 4gES_MAX_MEM: 4g
#不允许动态生成索引配置index.mapper.dynamic: false
修改linux允许所内存echo 'ulimit -l unlimited' >> /etc/profile. /etc/profile
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: