技术交流QQ群【JAVA,.NET,BigData,AI】:170933152

这东西用来做大数据检索,可以跟hadoop一起使用。

安装准备:

1.安装jdk

2.给虚拟机配置静态ip,可以查看其它博文怎么配置

3.开始安装:在centos7上操作

我把elasticsearch,放在了/usr/elasticsearch下面,到这个目录然后:

https://www.elastic.co/downloads/elasticsearch#preview-release 先去这里地址,找到rpm包,然后复制地址

执行:wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-beta1-x86_64.rpm

开始下载,挺大的得下一会儿

4.直接解压安装,超级方便,一步到位

rpm -ivh elasticsearch-2.3.5.rpm systemctl daemon-reloa//这个我没有执行成功,但是也没发现有什么影响

5.启动并查看安装状态,直接下载完解压,就可以启动起来

systemctl start elasticsearchsystemctl status elasticsearch

6.启动的日志

[root@localhost elasticsearch]# systemctl status elasticsearch
● elasticsearch.service - ElasticsearchLoaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)Active: active (running) since Mon 2019-03-04 01:32:11 CST; 19s agoDocs: http://www.elastic.coMain PID: 12458 (java)CGroup: /system.slice/elasticsearch.service├─12458 /lib/jvm/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.tt...└─12517 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

7.然后去访问一下看看:

curl -XGET "127.0.0.1:9200" 或者运行 curl http://localhost:9200 curl http://127.0.0.1:9200 都可以

8.可以看到没问题

{"name" : "node-1","cluster_name" : "elasticsearch","cluster_uuid" : "1QcPN8ZvQWKmeP-nP7UvkQ","version" : {"number" : "7.0.0-beta1","build_flavor" : "default","build_type" : "rpm","build_hash" : "15bb494","build_date" : "2019-02-13T12:30:14.432234Z","build_snapshot" : false,"lucene_version" : "8.0.0","minimum_wire_compatibility_version" : "6.7.0","minimum_index_compatibility_version" : "6.0.0-beta1"},"tagline" : "You Know, for Search"
}

9.但是这个时候从外面的浏览器访问,访问不了,这个时候这样配置,进入到下面的目录,然后编辑

elasticsearch.yml文件

node.name: node-1 前面的#打开

#network.host: 192.168.0.1
network.host: 192.168.136.110
#network.host: 0.0.0.0
#network.host: localhost
#network.host: 127.0.0.1  这里把network.host 设置为自己的ip地址 网上有设置成0.0.0.0的应该也可以自己设置一下试试

cluster.initial_master_nodes: ["node-1"] 这里一定要这样设置,我就是这里没有这样设置出问题的,弄了好久

在最后加上这两句,要不然,外面浏览器就访问不了哈

http.cors.enabled: true
http.cors.allow-origin: "*"

[root@localhost elasticsearch]# cd /etc/elasticsearch/
[root@localhost elasticsearch]# ll
total 48
-rw-r--r-- 1 root elasticsearch  5123 Mar  4 00:20 df
-rw-rw---- 1 root elasticsearch   207 Mar  3 21:28 elasticsearch.keystore
-rw-rw---- 1 root elasticsearch  3101 Mar  4 01:32 elasticsearch.yml
-rw-rw---- 1 root elasticsearch  3685 Feb 13 20:37 jvm.options
-rw-rw---- 1 root elasticsearch 17170 Feb 13 20:37 log4j2.properties
-rw-rw---- 1 root elasticsearch   473 Feb 13 20:37 role_mapping.yml
-rw-rw---- 1 root elasticsearch   197 Feb 13 20:37 roles.yml
-rw-rw---- 1 root elasticsearch     0 Feb 13 20:37 users
-rw-rw---- 1 root elasticsearch     0 Feb 13 20:37 users_roles
[root@localhost elasticsearch]# vi elasticsearch.yml# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
"elasticsearch.yml" 98L, 3101C
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
network.host: 192.168.136.110
#network.host: 0.0.0.0
#network.host: localhost
#network.host: 127.0.0.1
#
# Set a custom port for HTTP:
#
#http.port: 9200
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#discovery.seed_hosts:["my-application"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"

出了一些错误,具体是下面这几个

就是因上面的配置之前不对造成的,按照上面的配置完,再启动,就没有问题了

记录一下问题:
the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

一直都报这个错误,如果不配:

#cluster.initial_master_nodes: ["node-1", "node-2"]
cluster.initial_master_nodes: ["node-1"] 这个的话,这里的node-1是上面一个默认的记得打开就可以了

[2019-03-04T00:52:55,299][DEBUG][o.e.a.ActionModule       ] [localhost.localdomain] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-03-04T00:52:55,869][INFO ][o.e.d.DiscoveryModule    ] [localhost.localdomain] using discovery type [zen] and seed hosts providers [settings]
[2019-03-04T00:52:58,023][INFO ][o.e.n.Node               ] [localhost.localdomain] initialized
[2019-03-04T00:52:58,023][INFO ][o.e.n.Node               ] [localhost.localdomain] starting ...
[2019-03-04T00:52:58,317][INFO ][o.e.t.TransportService   ] [localhost.localdomain] publish_address {192.168.136.110:9300}, bound_addresses {[::]:9300}
[2019-03-04T00:52:58,336][INFO ][o.e.b.BootstrapChecks    ] [localhost.localdomain] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-03-04T00:52:58,427][ERROR][o.e.b.Bootstrap          ] [localhost.localdomain] node validation exception
[1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

网上还有说ES启动不能用Root用户的,我跟着也新建了一个用户,但是最终发现,不用这个新建的 用户也行,所以应该是不用新建用户,直接用root用户就可以的

成功后可以试试:

[root@localhost elasticsearch]# curl http://192.168.136.110:9200
{"name" : "node-1","cluster_name" : "elasticsearch","cluster_uuid" : "1QcPN8ZvQWKmeP-nP7UvkQ","version" : {"number" : "7.0.0-beta1","build_flavor" : "default","build_type" : "rpm","build_hash" : "15bb494","build_date" : "2019-02-13T12:30:14.432234Z","build_snapshot" : false,"lucene_version" : "8.0.0","minimum_wire_compatibility_version" : "6.7.0","minimum_index_compatibility_version" : "6.0.0-beta1"},"tagline" : "You Know, for Search"
}

然后在浏览器上同样:http://192.168.136.110:9200/试一试就可以了.

想起来还有个地方,如果有问题,可以把下面的这个地方配置上,

etc/sysctl.conf 中添加上

vm.max_map_count=655360

保存

然后执行

sysctl -p

然后再重启一下elasticsearch

[root@localhost etc]# vi sysctl.conf# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
vm.max_map_count=655360

下面找的详细点的:

elasticsearch修改config目录下的 yml文件后network.host: 0.0.0.0后,报bootstrap checks failed问题解决

修改次配置,是为了可以完成外网访问,但修改后,es启动失败了,

需要首先切换到root账户下,vim /etc/sysctl.conf

进入后,点击 键盘‘i’键,进入到编辑模式

添加此句话: vm.max_map_count=655360

当然,这一句前面要顶格写的,前面如果有#号,需要去掉

然后,点击 esc 键 ,退出编辑模式

在点击键盘 shift+:   冒号键,再输入  wq,敲回车,才算保存成功,这个是vim编辑模式的保存退出

在输入命令: sysctl -p      这句一定要再root账户下完成

之后切换回到 我们自己的账户下,启动es: ./elasticsearch 或者加上 -d, 已守护线程方式启动,

查看进程是否启动: ps -ef|grep elasticsearch

关闭es和关闭他的线程方式一样: kill -9 '进程号'

elasticsearch工作笔记002---Centos7.3安装最新版elasticsearch-7.0.0-beta1-x86_64.rpm单机版安装相关推荐

  1. Elasticsearch--Docker安装ES---全文检索引擎ElasticSearch工作笔记002

    然后我们来用docker来安装elasticsearch 这里我们使用vagrant 这个虚拟机,也就是oracle vm搭建的一个red hat系统实现的 这个虚拟机也可以用,VMware也行,但是 ...

  2. ElasticSearch启动报错curl: (7) Failed connect to 172.19.128.56:9200; 拒绝连接---ElasticSearch工作笔记029

    注意这里如果是在centos7系统中访问: curl http://localhost:9200/ 的时候也会报错,说拒绝连接,那么这个时候,就可能是 ElasticSearch工作笔记028 中说的 ...

  3. Linux / Windows系统中安装最新版 ElasticSearch (es)搜索引擎 超详细图文教程【一看就懂】

    "You Know, for Search"  相信来到这里的朋友们已经对ElasticSearch(es)有了一个大致的了解.关于Elasticsearch的介绍就不在此做过多赘 ...

  4. Google Chrome谷歌浏览器安装最新版Elasticsearch插件 图文教程 【一看就懂】

    我们在虚拟机安装了Elasticsearch后,往往还需要再安装一个可视化界面以便于使用.本文就教您如何在Google Chrome谷歌浏览器安装最新版Elasticsearch(es)插件. | 1 ...

  5. Centos7中安装ElasticSearch7.2_亲测可用_坑很多---ElasticSearch工作笔记026

    之前用docker安装过,但是现在需要用了,从centos7上安装,费了写功夫,记录下来,方便自己和 他人以后再装的时候,有个参考 2.首先要安装虚拟机,我在VMware中安装的,过程中碰到了很多问题 ...

  6. ElasticSearch7.2只能用localhost访问但不能用IP地址访问---ElasticSearch工作笔记027

    1.安装以后发现,在Centos7中,可以用 curl http://localhost:9200 这样来访问,但是如果通过 curl http://172.19.128.56:9200 就不能访问 ...

  7. Linux下安装最新版Elasticsearch

    一.前言 我安装的Elasticsearch版本为7.16.3,官网下载 或者 直接使用 wget 下载 7.16.3自带JDK 二.创建Elasticsearch目录 # 创建文件夹 [root@r ...

  8. 写最好的Docker安装最新版MySQL8(mysql-8.0.31)教程(参考Docker Hub和MySQL官方文档)

    一.前言   MySQL官方安装包下载地址:   https://dev.mysql.com/downloads/mysql/     Docker Hub官方网址:   https://hub.do ...

  9. 记录一次最新版MySQL-server-5.6.20-1.el6.x86_64.rpm的安装

    本以为很顺利的就能装完了. mysql的安装包 64位,5.6.20的 http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.20-1.e ...

最新文章

  1. vue ts 监听路由改变
  2. python 3d绘图平面_python 用 matplotlib 在 3D 空间中绘制平面 实例详解
  3. div 居中,浏览器兼容性
  4. POI导出人事报表:代码实现
  5. 读jQuery源码释疑笔记
  6. ASP.NET Core管道深度剖析(2):创建一个“迷你版”的管道来模拟真实管道请求处理流程
  7. Server's Revolution
  8. dateformat-参数表
  9. 最新!2020录取分数百强大学榜发布:清华文科第一,北大理科第一!
  10. Python的numpy,1.15.0和1.14.5,函数结果可能存在差异
  11. chrome 开发工具插件总结
  12. 在HTML列表入图片怎么变小,科技常识:html如何把图片大小变小
  13. sqli-labs 第八关盲注脚本
  14. Windows2016 L2TP配置(预共享密钥模式)
  15. Oracle 11gR2新特性--延迟段创建(Deferred Segment Creation)和exp不能导出空表
  16. fastboot烧录镜像--VTSGSI镜像替换
  17. 分布式系统CAP理论深入探索和分析
  18. 图像处理(6)--图像深度
  19. 我的未来作文计算机行业,我的未来作文(通用15篇)
  20. AO采集用友oracle,AO系统采集用友GRP-R9导出的ASD文件全过程

热门文章

  1. C语言小知识---特殊的字符串
  2. Linux常用最基础命令总结
  3. 使用Anaconda3安装tensorflow,opencv,使其可以在spyder中运行
  4. 解决问题__max 模型白色 材质球换没用
  5. 【前端小技巧】利用border画三角形及梯形
  6. pyqt,Qt Designer 界面布局子窗口可移动
  7. ArrayBuffer和TypedArray,以及Blob的使用
  8. 《数据分析实战 基于EXCEL和SPSS系列工具的实践》一3.2 用“逐步推进法”推测需要的数据...
  9. 项目管理中工时计算的问题
  10. oracle单列索引和组合索引性能测试