installation

Elasticsearch requires at least Java 7. Specifically as of this writing, it is recommended that you use the Oracle JDK version 1.8.0_73.

java -version
echo $JAVA_HOME

下载(Linux版本)

curl -L -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.3.1/elasticsearch-2.3.1.tar.gz

解压

tar -xvf elasticsearch-2.3.1.tar.gz

运行

cd elasticsearch-2.3.1/bin
./elasticsearch

若不能使用root运行,需要建立普通用户,并在用户目录(如/home/es/)下解压运行elasticSearch。

root@qiandu1-yuwencai:/opt/cluster/elasticsearch-2.3.1/bin# ./elasticsearch
Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
root@qiandu1-yuwencai:~# adduser es
Adding user `es' ...
Adding new group `es' (1001) ...
Adding new user `es' (1001) with group `es' ...
Creating home directory `/home/es' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for es
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
root@qiandu1-yuwencai:~# su es
es@qiandu1-yuwencai:/root$

运行结果

es@qiandu1-yuwencai:~/cluster/elasticsearch-2.3.1$ bin/elasticsearch
[2016-04-18 13:13:57,815][INFO ][node ] [Two-Gun Kid] version[2.3.1], pid[17929], build[bd98092/2016-04-04T12:25:05Z]
[2016-04-18 13:13:57,815][INFO ][node ] [Two-Gun Kid] initializing ...
[2016-04-18 13:13:58,497][INFO ][plugins ] [Two-Gun Kid] modules [reindex, lang-expression, lang-groovy], plugins [], sites []
[2016-04-18 13:13:58,522][INFO ][env ] [Two-Gun Kid] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [27gb], net total_space [39.2gb], spins? [possibly], types [ext4]
[2016-04-18 13:13:58,522][INFO ][env ] [Two-Gun Kid] heap size [990.7mb], compressed ordinary object pointers [true]
[2016-04-18 13:13:58,522][WARN ][env ] [Two-Gun Kid] max file descriptors [4096] for elasticsearch process likely too low, consider increasing to at least [65536]
[2016-04-18 13:14:01,473][INFO ][node ] [Two-Gun Kid] initialized
[2016-04-18 13:14:01,473][INFO ][node ] [Two-Gun Kid] starting ...
[2016-04-18 13:14:01,653][INFO ][transport ] [Two-Gun Kid] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2016-04-18 13:14:01,675][INFO ][discovery ] [Two-Gun Kid] elasticsearch/LVk2-D3hSgWWSZJx6PooDA
[2016-04-18 13:14:04,794][INFO ][cluster.service ] [Two-Gun Kid] new_master {Two-Gun Kid}{LVk2-D3hSgWWSZJx6PooDA}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-04-18 13:14:04,824][INFO ][http ] [Two-Gun Kid] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2016-04-18 13:14:04,824][INFO ][node ] [Two-Gun Kid] started
[2016-04-18 13:14:04,870][INFO ][gateway ] [Two-Gun Kid] recovered [0] indices into cluster_state

指定cluster和node名称:

./elasticsearch --cluster.name es_cluster --node.name es_node_1
[2016-04-18 13:46:51,572][INFO ][node                     ] [es_node_1] version[2.3.1], pid[18186], build[bd98092/2016-04-04T12:25:05Z]
[2016-04-18 13:46:51,573][INFO ][node ] [es_node_1] initializing ...
[2016-04-18 13:46:52,211][INFO ][plugins ] [es_node_1] modules [reindex, lang-expression, lang-groovy], plugins [], sites []
[2016-04-18 13:46:52,235][INFO ][env ] [es_node_1] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [27gb], net total_space [39.2gb], spins? [possibly], types [ext4]
[2016-04-18 13:46:52,236][INFO ][env ] [es_node_1] heap size [990.7mb], compressed ordinary object pointers [true]
[2016-04-18 13:46:52,236][WARN ][env ] [es_node_1] max file descriptors [4096] for elasticsearch process likely too low, consider increasing to at least [65536]
[2016-04-18 13:46:54,104][INFO ][node ] [es_node_1] initialized
[2016-04-18 13:46:54,104][INFO ][node ] [es_node_1] starting ...
[2016-04-18 13:46:54,209][INFO ][transport ] [es_node_1] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2016-04-18 13:46:54,215][INFO ][discovery ] [es_node_1] es_cluster/7PCeI9T4QfqJzA-B8eCYig
[2016-04-18 13:46:57,345][INFO ][cluster.service ] [es_node_1] new_master {es_node_1}{7PCeI9T4QfqJzA-B8eCYig}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-04-18 13:46:57,366][INFO ][http ] [es_node_1] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2016-04-18 13:46:57,366][INFO ][node ] [es_node_1] started
[2016-04-18 13:46:57,390][INFO ][gateway ] [es_node_1] recovered [0] indices into cluster_state

Also note the line marked http with information about the HTTP address (127.0.0.1) and port (9200) that our node is reachable from. By default, Elasticsearch uses port 9200 to provide access to its REST API. This port is configurable if necessary.

参考资料

【1】来源: https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html

【2】

-----------茂帅------------

java的版本要求是jdk 1.7 update 55之后 。推荐使用jdk 1.8

在root用户下的Linux需要创建一个新的用户,因为es不允许在root用户下面启动。如下操作:

1. Groupadd 组名称

2. Useradd -d 用户目录 -g 组名称 -G 其他组(如:root) 用户名称

3. 切换到新建的用户 su 用户名

下载es

curl -L -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.3.1/elasticsearch-2.3.1.tar.gz

启动es

./elasticsearch

启动es之后,es回给当前的node随机的命名一个英文名。可以通过以下命令来修改这个名字

./elasticsearch --cluster.name my_cluster_name --node.name my_node_name

es的默认的对外端口是9200

ES Docs-1:Installation Elasticsearch-2.3.1的更多相关文章

  1. 轻量级OLAP(二):Hive + Elasticsearch

    1. 引言 在做OLAP数据分析时,常常会遇到过滤分析需求,比如:除去只有性别.常驻地标签的用户,计算广告媒体上的覆盖UV.OLAP解决方案Kylin不支持复杂数据类型(array.struct.ma ...

  2. ES系列(一):编译准备与server启动过程解析

    ES作为强大的和流行的搜索引擎服务组件,为我们提供了方便的和高性能的搜索服务.在实际应用中也是用得比较爽,但如果能够更深入一点.虽然网上有许多的文章已经完整说明,ES是如何如何做到高性能,如何做到高可 ...

  3. ES系列(五):获取单条数据get处理过程实现

    前面讲的都是些比较大的东西,即框架层面的东西.今天咱们来个轻松点的,只讲一个点:如题,get单条记录的es查询实现. 1. get语义说明 get是用于搜索单条es的数据,是根据主键id查询数据方式. ...

  4. 全文检索:haystack+elasticsearch

    优点: 1.查询速度快 2.支持中文分词准备工作:安装es软件 1.拷贝到ubuntu 2.docker load -i 文件路径 3.配置 修改ip地址 4.docker run -dti --ne ...

  5. SpringBoot 2.x (12):整合Elasticsearch

    Elasticsearch:一个优秀的搜索引擎框架 搜索方面最基本的是SQL的like语句 进一步的有Lucene框架 后来有企业级的Solr框架 而Elasticsearch框架尤其适合于数据量特别 ...

  6. ElasticStack学习(九):深入ElasticSearch搜索之词项、全文本、结构化搜索及相关性算分

    一.基于词项与全文的搜索 1.词项 Term(词项)是表达语意的最小单位,搜索和利用统计语言模型进行自然语言处理都需要处理Term. Term的使用说明: 1)Term Level Query:Ter ...

  7. springboot集成elk 一: springboot + Elasticsearch

    1.ELK介绍 1> Elasticsearch是实时全文搜索和分析引擎, 提供搜集.分析.存储数据三大功能: 是一套开放REST和JAVA API等结构提供高效搜索功能,可扩展的分布式系统. ...

  8. ES系列(二):基于多播的集群发现实现原理解析

    ES作用超强悍的搜索引擎,除了需要具有齐全的功能支持,超高的性能,还必须要有任意扩展的能力.一定程度上,它是一个大数据产品.而要做扩展性,集群自然少不了.然而单独的集群又是不够的,能够做的事情太少,所 ...

  9. ES系列(三):网络通信模块解析

    ES是一个分布式搜索引擎,其除了用户提供必要的通信服务外,集群间也必须保持紧密的通信联系,才能在必要的时候给出正确的结果.其则必然涉及到各种繁多且要求高的通信场景,那么如何实现高性能的通信,则是其必须 ...

随机推荐

  1. 在Ubuntu上为Android系统的Application Frameworks层增加硬件访问服务【转】

    本文转载自:http://blog.csdn.net/luoshengyang/article/details/6578352 在数字科技日新月异的今天,软件和硬件的完美结合,造就了智能移动设备的流行 ...

  2. javascript数字时钟

    <html> <head> <script type="text/javascript"> function startTime() { var ...

  3. [算法]Evaluate Reverse Polish Notation

    Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, ...

  4. 一段神奇的代码,解决form表单背景偏黄问题

    一段神奇的代码,解决form表框背景偏黄问题 最近在做项目时,发现自己做的挺好看的表单,背景变成了黄色,所以这次折腾了好久终于找到了符合我的决绝办法,现在来分享给大家 一般解决这种input表框偏黄问 ...

  5. 分享知识-快乐自己:shiro 异常类型

    <!-- 身份认证异常 --> 1):身份令牌异常,不支持的身份令牌 --> org.apache.shiro.authc.pam.UnsupportedTokenException ...

  6. 2013面试C++小结

    2013年我在厦门c++求职小结 1.一般公司出的面试题目中的找错误,都是出自平常公司内部使用过程中出现的真实错误. 比如stl 中erase的使用:详细请见 :http://blog.csdn.ne ...

  7. C 字节对齐.我的算法学习之路

    C/C++基础笔试题1.0(字节对齐) http://blog.csdn.net/dengyaolongacmblog/article/details/37559687 我的算法学习之路 http:/ ...

  8. [深入学习C#]C#实现多线程的方法:线程(Thread类)和线程池(ThreadPool)

    简介 使用线程的主要原因:应用程序中一些操作需要消耗一定的时间,比如对文件.数据库.网络的访问等等,而我们不希望用户一直等待到操作结束,而是在此同时可以进行一些其他的操作.  这就可以使用线程来实现. ...

  9. Python基础-list,tuple,dict,set常用方法及区别

    1,列表list 列表定义方式 lis1=[1,2,3,4]#一维数组 lis2=[1,2,3,[4,5,6]]#二维数组 依次多有多维数据,套几层就是几维数组 列表的取值可以通过下标来,下标都是从0 ...

  10. C++如何拒绝编译器自动生成的函数

    每一个class,编译器都会自动生成四个特殊成员函数: destructor(析构函数) default constructor(默认构造函数) copy constructor(copy构造函数) ...