Elasticsearch

安装包

链接:https://pan.baidu.com/s/1Pk8FixNdgUySYUHwvP-qiA?pwd=7iwg
提取码:7iwg

所有需要安装的文件

在这里插入图片描述

Elasticsearch简称 es(一下均用简称)

Elasticsearch-安装-win版本

1. 解压 Elasticsearch

直接解压到你的某一个文件夹下-(注意不要有中文路径)

在这里插入图片描述

2.Elasticsearch解压后如下图

在这里插入图片描述

  • bin -启动脚本
  • config -配置文件
  • jdk -java写的所有jdk相关
  • lib -工具包
  • logs -日志
  • modules -模块
  • plugins -插件
3.配置文件
3.1 elasticsearch.yml -里面是es的基本配置

​ (查看配置文件发现,-端口号为9200) 可以不用修改用默认的,

在这里插入图片描述

3.2 jvm.options -修改

(是一些程序里边的java的配置参数的一个集合,不同的应用都会定义自己的jvm.options用来控制一些jvm的参数 )

修改堆占用大小为 -Xms512m -Xmx512m

在这里插入图片描述

4.启动

双击bin下的elasticsearch.bat 直接启动

在这里插入图片描述

4.1启动的日志信息
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME"
Future versions of Elasticsearch will require Java 11; your Java version from [D:\javaTools\java\jdk1.8\jdk1.8.0_311\jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.
Future versions of Elasticsearch will require Java 11; your Java version from [D:\javaTools\java\jdk1.8\jdk1.8.0_311\jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.
Warning: with JDK 8 on Windows, Elasticsearch may be unable to derive correct
  ergonomic settings due to a JDK issue (JDK-8074459). Please use a newer
  version of Java.
Warning: MaxDirectMemorySize may have been miscalculated due to JDK-8074459.
  Please use a newer version of Java or set MaxDirectMemorySize explicitly.
[2022-09-20T00:18:22,269][INFO ][o.e.n.Node               ] [LAPTOP-ET9MGQ9D] version[7.15.2], pid[26876], build[default/zip/93d5a7f6192e8a1a12e154a2b81bf6fa7309da0c/2021-11-04T14:04:42.515624022Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_311/25.311-b11]
[2022-09-20T00:18:22,270][INFO ][o.e.n.Node               ] [LAPTOP-ET9MGQ9D] JVM home [D:\javaTools\java\jdk1.8\jdk1.8.0_311\jre], using bundled JDK [false]
[2022-09-20T00:18:22,271][INFO ][o.e.n.Node               ] [LAPTOP-ET9MGQ9D] JVM arguments [-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, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,JRE, -Xms512m, -Xmx512m, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=C:\Users\niannian\AppData\Local\Temp\elasticsearch, -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, -XX:MaxDirectMemorySize=268435456, -Delasticsearch, -Des.path.home=D:\javaTools\elasticsearch-7.15.2-windows-x86_64\elasticsearch-7.15.2, -Des.path.conf=D:\javaTools\elasticsearch-7.15.2-windows-x86_64\elasticsearch-7.15.2\config, -Des.distribution.flavor=default, -Des.distribution.type=zip, -Des.bundled_jdk=true]
[2022-09-20T00:18:24,734][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [aggs-matrix-stats]
[2022-09-20T00:18:24,735][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [analysis-common]
[2022-09-20T00:18:24,735][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [constant-keyword]
[2022-09-20T00:18:24,735][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [frozen-indices]
[2022-09-20T00:18:24,735][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [ingest-common]
[2022-09-20T00:18:24,736][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [ingest-geoip]
[2022-09-20T00:18:24,736][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [ingest-user-agent]
[2022-09-20T00:18:24,736][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [kibana]
[2022-09-20T00:18:24,736][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [lang-expression]
[2022-09-20T00:18:24,736][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [lang-mustache]
[2022-09-20T00:18:24,736][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [lang-painless]
[2022-09-20T00:18:24,737][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [mapper-extras]
[2022-09-20T00:18:24,737][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [mapper-version]
[2022-09-20T00:18:24,737][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [parent-join]
[2022-09-20T00:18:24,737][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [percolator]
[2022-09-20T00:18:24,737][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [rank-eval]
[2022-09-20T00:18:24,737][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [reindex]
[2022-09-20T00:18:24,738][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [repositories-metering-api]
[2022-09-20T00:18:24,738][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [repository-encrypted]
[2022-09-20T00:18:24,738][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [repository-url]
[2022-09-20T00:18:24,738][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [runtime-fields-common]
[2022-09-20T00:18:24,738][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [search-business-rules]
[2022-09-20T00:18:24,738][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [searchable-snapshots]
[2022-09-20T00:18:24,739][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [snapshot-repo-test-kit]
[2022-09-20T00:18:24,739][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [spatial]
[2022-09-20T00:18:24,739][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [transform]
[2022-09-20T00:18:24,739][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [transport-netty4]
[2022-09-20T00:18:24,739][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [unsigned-long]
[2022-09-20T00:18:24,739][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [vector-tile]
[2022-09-20T00:18:24,740][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [vectors]
[2022-09-20T00:18:24,740][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [wildcard]
[2022-09-20T00:18:24,741][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-aggregate-metric]
[2022-09-20T00:18:24,741][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-analytics]
[2022-09-20T00:18:24,741][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-async]
[2022-09-20T00:18:24,741][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-async-search]
[2022-09-20T00:18:24,742][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-autoscaling]
[2022-09-20T00:18:24,742][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-ccr]
[2022-09-20T00:18:24,742][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-core]
[2022-09-20T00:18:24,743][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-data-streams]
[2022-09-20T00:18:24,743][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-deprecation]
[2022-09-20T00:18:24,743][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-enrich]
[2022-09-20T00:18:24,744][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-eql]
[2022-09-20T00:18:24,744][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-fleet]
[2022-09-20T00:18:24,744][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-graph]
[2022-09-20T00:18:24,744][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-identity-provider]
[2022-09-20T00:18:24,745][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-ilm]
[2022-09-20T00:18:24,745][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-logstash]
[2022-09-20T00:18:24,745][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-ml]
[2022-09-20T00:18:24,746][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-monitoring]
[2022-09-20T00:18:24,746][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-ql]
[2022-09-20T00:18:24,746][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-rollup]
[2022-09-20T00:18:24,747][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-security]
[2022-09-20T00:18:24,747][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-shutdown]
[2022-09-20T00:18:24,747][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-sql]
[2022-09-20T00:18:24,748][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-stack]
[2022-09-20T00:18:24,748][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-text-structure]
[2022-09-20T00:18:24,748][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-voting-only-node]
[2022-09-20T00:18:24,749][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] loaded module [x-pack-watcher]
[2022-09-20T00:18:24,749][INFO ][o.e.p.PluginsService     ] [LAPTOP-ET9MGQ9D] no plugins loaded
[2022-09-20T00:18:25,122][INFO ][o.e.e.NodeEnvironment    ] [LAPTOP-ET9MGQ9D] using [1] data paths, mounts [[Data (D:)]], net usable_space [179.3gb], net total_space [275.6gb], types [NTFS]
[2022-09-20T00:18:25,122][INFO ][o.e.e.NodeEnvironment    ] [LAPTOP-ET9MGQ9D] heap size [494.9mb], compressed ordinary object pointers [true]
[2022-09-20T00:18:25,509][INFO ][o.e.n.Node               ] [LAPTOP-ET9MGQ9D] node name [LAPTOP-ET9MGQ9D], node ID [BAsc73kuRoGXgt0sEC6BtA], cluster name [elasticsearch], roles [transform, data_frozen, master, remote_cluster_client, data, ml, data_content, data_hot, data_warm, data_cold, ingest]
[2022-09-20T00:18:28,973][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [LAPTOP-ET9MGQ9D] [controller/35408] [Main.cc@122] controller (64 bit): Version 7.15.2 (Build 65497bb5299534) Copyright (c) 2021 Elasticsearch BV
[2022-09-20T00:18:29,409][INFO ][o.e.x.s.a.s.FileRolesStore] [LAPTOP-ET9MGQ9D] parsed [0] roles from file [D:\javaTools\elasticsearch-7.15.2-windows-x86_64\elasticsearch-7.15.2\config\roles.yml]
[2022-09-20T00:18:30,260][INFO ][o.e.i.g.LocalDatabases   ] [LAPTOP-ET9MGQ9D] initialized default databases [[GeoLite2-Country.mmdb, GeoLite2-City.mmdb, GeoLite2-ASN.mmdb]], config databases [[]] and watching [D:\javaTools\elasticsearch-7.15.2-windows-x86_64\elasticsearch-7.15.2\config\ingest-geoip] for changes
[2022-09-20T00:18:30,263][INFO ][o.e.i.g.DatabaseRegistry ] [LAPTOP-ET9MGQ9D] initialized database registry, using geoip-databases directory [C:\Users\niannian\AppData\Local\Temp\elasticsearch\geoip-databases\BAsc73kuRoGXgt0sEC6BtA]
[2022-09-20T00:18:30,740][INFO ][o.e.t.NettyAllocator     ] [LAPTOP-ET9MGQ9D] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=1mb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=false, g1gc_region_size=0b, heap_size=494.9mb}]
[2022-09-20T00:18:30,792][INFO ][o.e.d.DiscoveryModule    ] [LAPTOP-ET9MGQ9D] using discovery type [zen] and seed hosts providers [settings]
[2022-09-20T00:18:31,155][INFO ][o.e.g.DanglingIndicesState] [LAPTOP-ET9MGQ9D] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2022-09-20T00:18:31,507][INFO ][o.e.n.Node               ] [LAPTOP-ET9MGQ9D] initialized
[2022-09-20T00:18:31,507][INFO ][o.e.n.Node               ] [LAPTOP-ET9MGQ9D] starting ...
[2022-09-20T00:18:31,520][INFO ][o.e.x.s.c.f.PersistentCache] [LAPTOP-ET9MGQ9D] persistent cache index loaded
[2022-09-20T00:18:32,341][INFO ][o.e.t.TransportService   ] [LAPTOP-ET9MGQ9D] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2022-09-20T00:18:32,443][WARN ][o.e.b.BootstrapChecks    ] [LAPTOP-ET9MGQ9D] 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
[2022-09-20T00:18:32,452][INFO ][o.e.c.c.ClusterBootstrapService] [LAPTOP-ET9MGQ9D] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2022-09-20T00:18:35,471][INFO ][o.e.c.c.Coordinator      ] [LAPTOP-ET9MGQ9D] setting initial configuration to VotingConfiguration{BAsc73kuRoGXgt0sEC6BtA}
[2022-09-20T00:18:35,585][INFO ][o.e.c.s.MasterService    ] [LAPTOP-ET9MGQ9D] elected-as-master ([1] nodes joined)[{LAPTOP-ET9MGQ9D}{BAsc73kuRoGXgt0sEC6BtA}{RaQByXzFQlqIiS6Jyt2nZg}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 1, version: 1, delta: master node changed {previous [], current [{LAPTOP-ET9MGQ9D}{BAsc73kuRoGXgt0sEC6BtA}{RaQByXzFQlqIiS6Jyt2nZg}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}]}
[2022-09-20T00:18:35,619][INFO ][o.e.c.c.CoordinationState] [LAPTOP-ET9MGQ9D] cluster UUID set to [bDkJ0xdVSEmptv2ZKuPySQ]
[2022-09-20T00:18:35,644][INFO ][o.e.c.s.ClusterApplierService] [LAPTOP-ET9MGQ9D] master node changed {previous [], current [{LAPTOP-ET9MGQ9D}{BAsc73kuRoGXgt0sEC6BtA}{RaQByXzFQlqIiS6Jyt2nZg}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
[2022-09-20T00:18:35,753][INFO ][o.e.g.GatewayService     ] [LAPTOP-ET9MGQ9D] recovered [0] indices into cluster_state
[2022-09-20T00:18:35,905][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [.ml-stats] for index patterns [.ml-stats-*]
[2022-09-20T00:18:35,957][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [.ml-state] for index patterns [.ml-state*]
[2022-09-20T00:18:36,012][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [.ml-notifications-000002] for index patterns [.ml-notifications-000002]
[2022-09-20T00:18:36,067][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [.ml-anomalies-] for index patterns [.ml-anomalies-*]
[2022-09-20T00:18:36,108][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [metrics-mappings]
[2022-09-20T00:18:36,145][INFO ][o.e.h.AbstractHttpServerTransport] [LAPTOP-ET9MGQ9D] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2022-09-20T00:18:36,146][INFO ][o.e.n.Node               ] [LAPTOP-ET9MGQ9D] started
[2022-09-20T00:18:36,157][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [data-streams-mappings]
[2022-09-20T00:18:36,193][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [synthetics-settings]
[2022-09-20T00:18:36,232][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [logs-settings]
[2022-09-20T00:18:36,265][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [logs-mappings]
[2022-09-20T00:18:36,295][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [metrics-settings]
[2022-09-20T00:18:36,323][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [synthetics-mappings]
[2022-09-20T00:18:36,366][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [.watch-history-13] for index patterns [.watcher-history-13*]
[2022-09-20T00:18:36,399][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [ilm-history] for index patterns [ilm-history-5*]
[2022-09-20T00:18:36,430][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [.slm-history] for index patterns [.slm-history-5*]
[2022-09-20T00:18:36,457][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [.deprecation-indexing-settings]
[2022-09-20T00:18:36,486][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding component template [.deprecation-indexing-mappings]
[2022-09-20T00:18:36,514][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding template [.monitoring-alerts-7] for index patterns [.monitoring-alerts-7]
[2022-09-20T00:18:36,583][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding template [.monitoring-es] for index patterns [.monitoring-es-7-*]
[2022-09-20T00:18:36,613][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-7-*]
[2022-09-20T00:18:36,643][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-7-*]
[2022-09-20T00:18:36,673][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding template [.monitoring-beats] for index patterns [.monitoring-beats-7-*]
[2022-09-20T00:18:36,702][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [logs] for index patterns [logs-*-*]
[2022-09-20T00:18:36,729][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [metrics] for index patterns [metrics-*-*]
[2022-09-20T00:18:36,759][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [synthetics] for index patterns [synthetics-*-*]
[2022-09-20T00:18:36,785][INFO ][o.e.c.m.MetadataIndexTemplateService] [LAPTOP-ET9MGQ9D] adding index template [.deprecation-indexing-template] for index patterns [.logs-deprecation.*]
[2022-09-20T00:18:36,811][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [ml-size-based-ilm-policy]
[2022-09-20T00:18:36,844][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [metrics]
[2022-09-20T00:18:36,870][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [synthetics]
[2022-09-20T00:18:36,905][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [logs]
[2022-09-20T00:18:36,931][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [watch-history-ilm-policy]
[2022-09-20T00:18:36,958][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [ilm-history-ilm-policy]
[2022-09-20T00:18:36,989][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [slm-history-ilm-policy]
[2022-09-20T00:18:37,016][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [.deprecation-indexing-ilm-policy]
[2022-09-20T00:18:37,040][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [LAPTOP-ET9MGQ9D] adding index lifecycle policy [.fleet-actions-results-ilm-policy]
[2022-09-20T00:18:37,091][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] updating geoip databases
[2022-09-20T00:18:37,093][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] fetching geoip databases overview from [https://geoip.elastic.co/v1/database?elastic_geoip_service_tos=agree]
[2022-09-20T00:18:37,152][INFO ][o.e.l.LicenseService     ] [LAPTOP-ET9MGQ9D] license [f799f649-6304-4d80-a4e8-93cace01d014] mode [basic] - valid
[2022-09-20T00:18:37,153][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [LAPTOP-ET9MGQ9D] Active license is now [BASIC]; Security is disabled
[2022-09-20T00:18:37,153][WARN ][o.e.x.s.s.SecurityStatusChangeListener] [LAPTOP-ET9MGQ9D] Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.15/security-minimal-setup.html to enable security.
[2022-09-20T00:18:38,225][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] updating geoip database [GeoLite2-ASN.mmdb]
[2022-09-20T00:18:40,621][INFO ][o.e.c.m.MetadataCreateIndexService] [LAPTOP-ET9MGQ9D] [.geoip_databases] creating index, cause [auto(bulk api)], templates [], shards [1]/[0]
[2022-09-20T00:18:40,788][INFO ][o.e.c.r.a.AllocationService] [LAPTOP-ET9MGQ9D] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.geoip_databases][0]]]).
[2022-09-20T00:18:41,424][INFO ][o.e.i.g.DatabaseRegistry ] [LAPTOP-ET9MGQ9D] downloading geoip database [GeoLite2-ASN.mmdb] to [C:\Users\niannian\AppData\Local\Temp\elasticsearch\geoip-databases\BAsc73kuRoGXgt0sEC6BtA\GeoLite2-ASN.mmdb.tmp.gz]
[2022-09-20T00:18:41,430][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] updated geoip database [GeoLite2-ASN.mmdb]
[2022-09-20T00:18:41,441][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] updating geoip database [GeoLite2-City.mmdb]
[2022-09-20T00:18:41,574][INFO ][o.e.i.g.DatabaseRegistry ] [LAPTOP-ET9MGQ9D] successfully reloaded changed geoip database file [C:\Users\niannian\AppData\Local\Temp\elasticsearch\geoip-databases\BAsc73kuRoGXgt0sEC6BtA\GeoLite2-ASN.mmdb]
[2022-09-20T00:18:44,728][INFO ][o.e.i.g.DatabaseRegistry ] [LAPTOP-ET9MGQ9D] downloading geoip database [GeoLite2-City.mmdb] to [C:\Users\niannian\AppData\Local\Temp\elasticsearch\geoip-databases\BAsc73kuRoGXgt0sEC6BtA\GeoLite2-City.mmdb.tmp.gz]
[2022-09-20T00:18:44,737][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] updated geoip database [GeoLite2-City.mmdb]
[2022-09-20T00:18:44,738][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] updating geoip database [GeoLite2-Country.mmdb]
[2022-09-20T00:18:45,428][INFO ][o.e.i.g.DatabaseRegistry ] [LAPTOP-ET9MGQ9D] successfully reloaded changed geoip database file [C:\Users\niannian\AppData\Local\Temp\elasticsearch\geoip-databases\BAsc73kuRoGXgt0sEC6BtA\GeoLite2-City.mmdb]
[2022-09-20T00:18:45,696][INFO ][o.e.i.g.DatabaseRegistry ] [LAPTOP-ET9MGQ9D] downloading geoip database [GeoLite2-Country.mmdb] to [C:\Users\niannian\AppData\Local\Temp\elasticsearch\geoip-databases\BAsc73kuRoGXgt0sEC6BtA\GeoLite2-Country.mmdb.tmp.gz]
[2022-09-20T00:18:45,703][INFO ][o.e.i.g.GeoIpDownloader  ] [LAPTOP-ET9MGQ9D] updated geoip database [GeoLite2-Country.mmdb]
[2022-09-20T00:18:45,757][INFO ][o.e.i.g.DatabaseRegistry ] [LAPTOP-ET9MGQ9D] successfully reloaded changed geoip database file [C:\Users\niannian\AppData\Local\Temp\elasticsearch\geoip-databases\BAsc73kuRoGXgt0sEC6BtA\GeoLite2-Country.mmdb]

4.2 查看启动日志,找到此行.
在这里插入图片描述

4.3 访问 http://localhost:9200/
在这里插入图片描述

{
  "name" : "LAPTOP-ET9MGQ9D", #主机名称
  "cluster_name" : "elasticsearch", # 集群名称
  "cluster_uuid" : "bDkJ0xdVSEmptv2ZKuPySQ", #集群UUid
  "version" : {
    "number" : "7.15.2", #版本号
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "93d5a7f6192e8a1a12e154a2b81bf6fa7309da0c",
    "build_date" : "2021-11-04T14:04:42.515624022Z",
    "build_snapshot" : false,
    "lucene_version" : "8.9.0", # lucene版本号
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

es-head 可视化插件安装

1.打开谷歌浏览器
2 .添加扩展head插件

三个点–>更多工具–>扩展程序

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nZ0EOKO0-1663608584800)(img/09.png)]

3.安装插件

将开发者模式打开-直接将文件拖进去-

在这里插入图片描述

4.固定显示

在这里插入图片描述

5.点击

在这里插入图片描述

postman调用

1.新建一个请求

请求地址: http://localhost:9200/_analyze

用post请求方式

1.1参数
{
    "text" : "我想要个女朋友",
    "analyzer" : "standard"
}

在这里插入图片描述

1.3返回的结果
{
    "tokens": [
        {
            "token": "我",
            "start_offset": 0,
            "end_offset": 1,
            "type": "<IDEOGRAPHIC>",
            "position": 0
        },
        {
            "token": "想",
            "start_offset": 1,
            "end_offset": 2,
            "type": "<IDEOGRAPHIC>",
            "position": 1
        },
        {
            "token": "要",
            "start_offset": 2,
            "end_offset": 3,
            "type": "<IDEOGRAPHIC>",
            "position": 2
        },
        {
            "token": "个",
            "start_offset": 3,
            "end_offset": 4,
            "type": "<IDEOGRAPHIC>",
            "position": 3
        },
        {
            "token": "女",
            "start_offset": 4,
            "end_offset": 5,
            "type": "<IDEOGRAPHIC>",
            "position": 4
        },
        {
            "token": "朋",
            "start_offset": 5,
            "end_offset": 6,
            "type": "<IDEOGRAPHIC>",
            "position": 5
        },
        {
            "token": "友",
            "start_offset": 6,
            "end_offset": 7,
            "type": "<IDEOGRAPHIC>",
            "position": 6
        }
    ]
}

可以看到分词的结果不符合我们的语言标准.比如 友在我们心中不算一个词,.应该是女朋友 或者朋友 那如何实现呢,这里我们就需要用到ik分词器的支持了,下面我们来安装ik分词器

安装ik分词器

1.将ik分词器解压

到你安装的elasticsearch的\plugins 地址下

2.新建一个ik文件夹

在这里插入图片描述

(注意: 删掉zip的包)

在这里插入图片描述

重启es

安装完成,关掉之前启动的es-直接叉掉

在这里插入图片描述

重启es

在这里插入图片描述

重新使用postman测试ik分词器是否生效

ik分词器有两个分词器 ik_smart 智能分词ik_max_word 最大粒度分词

1 . ik_smart 智能分词

在这里插入图片描述

1.1 ik_smart分词结果
{
    "tokens": [
        {
            "token": "我",
            "start_offset": 0,
            "end_offset": 1,
            "type": "CN_CHAR",
            "position": 0
        },
        {
            "token": "想要",
            "start_offset": 1,
            "end_offset": 3,
            "type": "CN_WORD",
            "position": 1
        },
        {
            "token": "个",
            "start_offset": 3,
            "end_offset": 4,
            "type": "CN_CHAR",
            "position": 2
        },
        {
            "token": "女朋友",
            "start_offset": 4,
            "end_offset": 7,
            "type": "CN_WORD",
            "position": 3
        }
    ]
}
2 . ik_max_word 最大粒度分词

在这里插入图片描述

2.1 ik_max_word分词结果
{
    "tokens": [
        {
            "token": "我",
            "start_offset": 0,
            "end_offset": 1,
            "type": "CN_CHAR",
            "position": 0
        },
        {
            "token": "想要",
            "start_offset": 1,
            "end_offset": 3,
            "type": "CN_WORD",
            "position": 1
        },
        {
            "token": "个",
            "start_offset": 3,
            "end_offset": 4,
            "type": "CN_CHAR",
            "position": 2
        },
        {
            "token": "女朋友",
            "start_offset": 4,
            "end_offset": 7,
            "type": "CN_WORD",
            "position": 3
        },
        {
            "token": "朋友",
            "start_offset": 5,
            "end_offset": 7,
            "type": "CN_WORD",
            "position": 4
        }
    ]
}
3. 自定义分词器

IKAnalyzer.cfg.xml - 为ik分词器的配置文件-用户可以在这里配置自己的扩展字典

3.1 找到ik的安装目录下的config

新建一个 mywod.dic

在这里插入图片描述

3.2 修改myword.dic文件

在这里插入图片描述

3.3 将mywod.dic文件放到扩展配置文件中

在这里插入图片描述

重启es
关掉之前启动的es-直接叉掉

在这里插入图片描述

重启es-测试自定义分词器

在这里插入图片描述

调用postman

在这里插入图片描述

查看效果-实现自定义分词
{
    "tokens": [
        {
            "token": "张晓婷",
            "start_offset": 0,
            "end_offset": 3,
            "type": "CN_WORD",
            "position": 0
        }
    ]
}
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐