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. C++难点的一些总结

    一. C++成员函数的重载 C++中的成员函数有四种,分别是普通成员函数,virtual虚函数,const成员函数. (1) void func(int a); (2) virtual void fu ...

  2. JavaWeb -- Cookie应用实例 -- 购物历史记录

    1. 页面一:主页面                                         页面二: 详细显示页面   Demo2 负责页面一, 显示商品清单和历史记录 Demo3负责页面二 ...

  3. Qt窗口屏幕居中显示

    转自--> http://blog.chinaunix.net/uid-20718335-id-364404.html 窗口的屏幕居中显示问题,在各开发工具中原理相同,首先使用特定的方法得到显示 ...

  4. 大话设计模式--工厂方法模式 Factory Method -- C++实现

    1. 工厂方法模式 定义一个用于创建对象的接口, 让子类决定实例化哪一个类,工厂方法使一个类的实例化延迟到其子类. 和简单工厂模式相比: A: 简单工厂模式最大的优点在于工厂类中包含有必要的逻辑判断, ...

  5. ubantu卸载软件

    参考:https://blog.csdn.net/luckydog612/article/details/80877179 https://blog.csdn.net/get_set/article/ ...

  6. R Customizing graphics

    Customizing graphics GraphicsLaTeXLattice (Treillis) plots In this chapter (it tends to be overly co ...

  7. Android Studio Mac版快捷键

    mac上按键符号 ⌥ : option / alt ⇧ : shift ⌃ : control ⌘ : command ⎋ : esc (一)查找/查看相关 搜索任意内容 双击 sft 当前文件查找/ ...

  8. SetOperations

    无序集合,add的顺序不是存储顺序 1.add(K key, V value) 2.difference(K key, otherK[s]) :差集,返回Set 3.differenceAndStor ...

  9. 分享知识-快乐自己:Java常用API总结

    1):java.io.BufferedReader类(用于从文件中读入一段字符:所属套件:java.io) 1. 构造函数BufferedReader(java.io.FileReader FileR ...

  10. 浏览器对应的selenium版本问题

    在selenium+python环境下查看selenium版本方法: cmd下输入:pip show selenium 卸载selenium版本: cmd下输入:pip uninstall selen ...