Elasticsearch安装说明
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Elasticsearch安装说明,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1819字,纯文字阅读大概需要3分钟。
内容图文
ElasticSearch
是一个基于Lucene构建的开源,分布式,RESTful搜索引擎。设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便
1、 下载jdk-7u71-linux-x64.gz
2、 Tar zxvf jdk-7u71-linux-x64.gz
3、 mv jdk1.7.0_71/ /home/work/local/java/
4、 vim /etc/profile
export JAVA_HOME=/home/work/local/java
exportJRE_HOME=/home/work/local/java/jre
exportCLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
5、 java –version
6、 tar zxvf elasticsearch-1.3.4.tar.gz
7、 cd elasticsearch-1.3.4/config
8、 vim elasticsearch.yml
node.name: "hiwechat"
index.number_of_shards: 10
index.number_of_replicas: 1
9、 cd ../bin
10、 ./ elasticsearch –d
11、 telnet 127.0.0.1 9300
12、 ./plugin -installmedcl/elasticsearch-analysis-ik/1.0.0
13、 cd ../config/
14、 wget http://github.com/downloads/medcl/elasticsearch-analysis-ik/ik.zip
15、 unzip ik.zip
16、 rm -rf ik.zip
17、 yum install python-pip
18、 pip install argparse
19、 pip install elasticsearch
20、 curl -X GET localhost:9200
21、 python
>>> from datetime import datetime
>>> from elasticsearch import Elasticsearch
# by default we connect to localhost:9200
>>> es = Elasticsearch()
# create an index in elasticsearch, ignore status code 400 (index alreadyexists)
>>> es.indices.create(index=‘my-index‘, ignore=400)
{u‘acknowledged‘: True}
# datetimes will be serialized
>>> es.index(index="my-index",doc_type="test-type", id=42, body={"any": "data","timestamp": datetime.now()})
{u‘_id‘: u‘42‘, u‘_index‘: u‘my-index‘, u‘_type‘: u‘test-type‘,u‘_version‘: 1, u‘ok‘: True}
# but not deserialized
>>> es.get(index="my-index",doc_type="test-type", id=42)[‘_source‘]
{u‘any‘: u‘data‘, u‘timestamp‘: u‘2013-05-12T19:45:31.804229‘}
参考资料:
https://github.com/elasticsearch/elasticsearch-py
原文:http://witer666.blog.51cto.com/625539/1572101
内容总结
以上是互联网集市为您收集整理的Elasticsearch安装说明全部内容,希望文章能够帮你解决Elasticsearch安装说明所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。