IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 大数据 -> Elasticsearch安装使用 -> 正文阅读

[大数据]Elasticsearch安装使用

1. 下载
[root@localhost src]#??wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.12.tar.gz
2. 解压
?[root@localhost src]#??tar -zxvf elasticsearch-6.8.12.tar.gz
3. 移动到指定目录下
[root@localhost src]# mv elasticsearch-6.8.12 /opt/
[root@localhost src]# cd /opt/
[root@localhost opt]# ll
总用量 0
drwxr-xr-x. 8 631 503 143 8月 ?12 2020 elasticsearch-6.8.12

4. es只能在非root用户下启动

[root@localhost opt]# cd elasticsearch-6.8.12/
[root@localhost elasticsearch-6.8.12]# useradd es
[root@localhost elasticsearch-6.8.12]# passwd es
更改用户 ess 的密码 。
新的 密码:
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@localhost opt]# chown es -R elasticsearch-6.8.12/
[root@localhost opt]# ll
总用量 0
drwxr-xr-x. 8 es 503 143 8月 ?12 2020 elasticsearch-6.8.12
[root@localhost elasticsearch-6.8.12]# ll
总用量 460
drwxr-xr-x. ?3 es 503 ? 4096 7月 ?25 18:21 bin
drwxr-xr-x. ?2 es 503 ? ?178 7月 ?25 19:10 config
drwxr-xr-x. ?3 es 503 ? 4096 7月 ?25 18:21 lib
-rw-r--r--. ?1 es 503 ?13675 8月 ?12 2020 LICENSE.txt
drwxr-xr-x. ?2 es 503 ? ?249 7月 ?25 19:05 logs
drwxr-xr-x. 31 es 503 ? 4096 8月 ?12 2020 modules
-rw-r--r--. ?1 es 503 427502 8月 ?12 2020 NOTICE.txt
drwxr-xr-x. ?2 es 503 ? ? ?6 8月 ?12 2020 plugins
-rw-r--r--. ?1 es 503 ? 8534 8月 ?12 2020 README.textile

[root@localhost elasticsearch-6.8.12]# su es
[es@localhost elasticsearch-6.8.12]$ cd config/
[es@localhost config]$ ll
总用量 36
-rw-rw----. 1 es root ? 199 7月 ?25 19:05 elasticsearch.keystore
-rw-r-----. 1 es ?503 ?2856 7月 ?25 19:03 elasticsearch.yml
-rw-r-----. 1 es ?503 ?3885 8月 ?12 2020 jvm.options
-rw-r-----. 1 es ?503 13085 8月 ?12 2020 log4j2.properties
-rw-r-----. 1 es ?503 ? 473 8月 ?12 2020 role_mapping.yml
-rw-r-----. 1 es ?503 ? 197 8月 ?12 2020 roles.yml
-rw-r-----. 1 es ?503 ? ? 0 8月 ?12 2020 users
-rw-r-----. 1 es ?503 ? ? 0 8月 ?12 2020 users_roles

5.修改JVM内存参数,不然可能启动不了,直接killed

[es@localhost config]$ vim jvm.options

[es@localhost config]$ cd ../
[es@localhost elasticsearch-6.8.12]$ cd bin/
[es@localhost bin]$ ./elasticsearch
[2021-07-25T20:05:33,036][INFO ][o.e.e.NodeEnvironment ? ?] [w32xLwK] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [1.8gb], net total_space [6.1gb], types [rootfs]
[2021-07-25T20:05:33,039][INFO ][o.e.e.NodeEnvironment ? ?] [w32xLwK] heap size [503.6mb], compressed ordinary object pointers [true]
[2021-07-25T20:05:33,040][INFO ][o.e.n.Node ? ? ? ? ? ? ? ] [w32xLwK] node name derived from node ID [w32xLwKMRSiVRg42cdZ5kQ]; set [node.name] to override
[2021-07-25T20:05:33,041][INFO ][o.e.n.Node ? ? ? ? ? ? ? ] [w32xLwK] version[6.8.12], pid[2925], build[default/tar/7a15d2a/2020-08-12T07:27:20.804867Z], OS[Linux/3.10.0-862.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_191/25.191-b12]
[2021-07-25T20:05:33,041][INFO ][o.e.n.Node ? ? ? ? ? ? ? ] [w32xLwK] JVM arguments [-Xms512m, -Xmx512m, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-3167282046876579994, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/opt/elasticsearch-6.8.12, -Des.path.conf=/opt/elasticsearch-6.8.12/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [aggs-matrix-stats]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [analysis-common]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [ingest-common]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [ingest-geoip]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [ingest-user-agent]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [lang-expression]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [lang-mustache]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [lang-painless]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [mapper-extras]
[2021-07-25T20:05:36,435][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [parent-join]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [percolator]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [rank-eval]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [reindex]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [repository-url]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [transport-netty4]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [tribe]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-ccr]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-core]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-deprecation]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-graph]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-ilm]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-logstash]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-ml]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-monitoring]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-rollup]
[2021-07-25T20:05:36,436][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-security]
[2021-07-25T20:05:36,437][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-sql]
[2021-07-25T20:05:36,437][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-upgrade]
[2021-07-25T20:05:36,437][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] loaded module [x-pack-watcher]
[2021-07-25T20:05:36,437][INFO ][o.e.p.PluginsService ? ? ] [w32xLwK] no plugins loaded
[2021-07-25T20:05:40,926][INFO ][o.e.x.s.a.s.FileRolesStore] [w32xLwK] parsed [0] roles from file [/opt/elasticsearch-6.8.12/config/roles.yml]
[2021-07-25T20:05:41,869][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [w32xLwK] [controller/2980] [Main.cc@114] controller (64 bit): Version 6.8.12 (Build 39bf066b214253) Copyright (c) 2020 Elasticsearch BV
[2021-07-25T20:05:42,373][DEBUG][o.e.a.ActionModule ? ? ? ] [w32xLwK] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2021-07-25T20:05:42,657][INFO ][o.e.d.DiscoveryModule ? ?] [w32xLwK] using discovery type [zen] and host providers [settings]
[2021-07-25T20:05:43,654][INFO ][o.e.n.Node ? ? ? ? ? ? ? ] [w32xLwK] initialized
[2021-07-25T20:05:43,654][INFO ][o.e.n.Node ? ? ? ? ? ? ? ] [w32xLwK] starting ...
[2021-07-25T20:05:43,842][INFO ][o.e.t.TransportService ? ] [w32xLwK] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2021-07-25T20:05:43,859][WARN ][o.e.b.BootstrapChecks ? ?] [w32xLwK] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2021-07-25T20:05:43,859][WARN ][o.e.b.BootstrapChecks ? ?] [w32xLwK] max number of threads [3872] for user [es] is too low, increase to at least [4096]
[2021-07-25T20:05:43,859][WARN ][o.e.b.BootstrapChecks ? ?] [w32xLwK] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2021-07-25T20:05:46,923][INFO ][o.e.c.s.MasterService ? ?] [w32xLwK] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {w32xLwK}{w32xLwKMRSiVRg42cdZ5kQ}{qpcWMtoJSZ6MEw8FnxKbFQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=1039880192, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2021-07-25T20:05:46,931][INFO ][o.e.c.s.ClusterApplierService] [w32xLwK] new_master {w32xLwK}{w32xLwKMRSiVRg42cdZ5kQ}{qpcWMtoJSZ6MEw8FnxKbFQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=1039880192, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {w32xLwK}{w32xLwKMRSiVRg42cdZ5kQ}{qpcWMtoJSZ6MEw8FnxKbFQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=1039880192, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2021-07-25T20:05:47,011][INFO ][o.e.h.n.Netty4HttpServerTransport] [w32xLwK] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2021-07-25T20:05:47,011][INFO ][o.e.n.Node ? ? ? ? ? ? ? ] [w32xLwK] started
[2021-07-25T20:05:47,015][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [w32xLwK] Failed to clear cache for realms [[]]
[2021-07-25T20:05:47,073][INFO ][o.e.g.GatewayService ? ? ] [w32xLwK] recovered [0] indices into cluster_state
[2021-07-25T20:05:47,299][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-6-*]
[2021-07-25T20:05:47,383][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.triggered_watches] for index patterns [.triggered_watches*]
[2021-07-25T20:05:47,422][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.watches] for index patterns [.watches*]
[2021-07-25T20:05:47,505][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.watch-history-9] for index patterns [.watcher-history-9*]
[2021-07-25T20:05:47,576][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.monitoring-es] for index patterns [.monitoring-es-6-*]
[2021-07-25T20:05:47,608][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.monitoring-beats] for index patterns [.monitoring-beats-6-*]
[2021-07-25T20:05:47,654][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.monitoring-alerts] for index patterns [.monitoring-alerts-6]
[2021-07-25T20:05:47,725][INFO ][o.e.c.m.MetaDataIndexTemplateService] [w32xLwK] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-6-*]
[2021-07-25T20:05:47,905][INFO ][o.e.l.LicenseService ? ? ] [w32xLwK] license [437e59f0-fad8-4456-b193-ad5213580e7a] mode [basic] - valid

6. 检查启动是否成功及查看es节点

[root@localhost ~]# curl localhost:9200
{
? "name" : "w32xLwK",
? "cluster_name" : "elasticsearch",
? "cluster_uuid" : "Qz7zminvTla5pHQQu2DyZQ",
? "version" : {
? ? "number" : "6.8.12",
? ? "build_flavor" : "default",
? ? "build_type" : "tar",
? ? "build_hash" : "7a15d2a",
? ? "build_date" : "2020-08-12T07:27:20.804867Z",
? ? "build_snapshot" : false,
? ? "lucene_version" : "7.7.3",
? ? "minimum_wire_compatibility_version" : "5.6.0",
? ? "minimum_index_compatibility_version" : "5.0.0"
? },
? "tagline" : "You Know, for Search"
}
[root@localhost ~]# curl localhost:9200/_cat/nodes?v
ip ? ? ? ?heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
127.0.0.1 ? ? ? ? ? 20 ? ? ? ? ?92 ? 0 ? ?0.00 ? ?0.06 ? ? 0.06 mdi ? ? ? * ? ? ?w32xLwK

  大数据 最新文章
实现Kafka至少消费一次
亚马逊云科技:还在苦于ETL?Zero ETL的时代
初探MapReduce
【SpringBoot框架篇】32.基于注解+redis实现
Elasticsearch:如何减少 Elasticsearch 集
Go redis操作
Redis面试题
专题五 Redis高并发场景
基于GBase8s和Calcite的多数据源查询
Redis——底层数据结构原理
上一篇文章      下一篇文章      查看所有文章
加:2021-07-26 12:08:54  更:2021-07-26 12:09:42 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年4日历 -2024/4/20 6:31:24-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码