ElasticSearch-7.3.0 需要 JDK11 否则无法启动,这里测试的是 ElasticSearch-6.5.0 ,如果使用 ElasticSearch-7.3.0 配置也是一样
############################################################
# springboot-2.x 整合 elasticsearch-7.3.0 配置
############################################################
#开启 Elasticsearch 仓库(默认值:true)
spring.data.elasticsearch.repositories.enabled=true
#默认 9300 是 Java 客户端的端口。9200 是支持 Restful HTTP 的接口
spring.data.elasticsearch.cluster-nodes = 127.0.0.1:9300
# Elasticsearch 集群名(默认值: elasticsearch)
spring.data.elasticsearch.cluster-name=my-application
#集群节点地址列表,用逗号分隔。如果没有指定,就启动一个客户端节点
#spring.data.elasticsearch.cluster-nodes=
#用来配置客户端的额外属性
#spring.data.elasticsearch.propertie=
#存储索引的位置
#spring.data.elasticsearch.properties.path.home=/data/project/target/elastic
#连接超时的时间
spring.data.elasticsearch.properties.transport.tcp.connect_timeout=120s
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0modelVersion>
<parent>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-parentartifactId>
<version>2.1.9.RELEASEversion>
<relativePath />
parent>
<groupId>com.xu.springbootgroupId>
<artifactId>ElasticSearchartifactId>
<version>0.0.1-SNAPSHOTversion>
<name>ElasticSearchname>
<description>Demo project for Spring Bootdescription>
<properties>
<java.version>1.8java.version>
properties>
<dependencies>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-webartifactId>
dependency>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-data-elasticsearchartifactId>
dependency>
<dependency>
<groupId>org.elasticsearch.clientgroupId>
<artifactId>transportartifactId>
dependency>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-devtoolsartifactId>
<scope>runtimescope>
<optional>trueoptional>
dependency>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-testartifactId>
<scope>testscope>
dependency>
<dependency>
<groupId>org.projectlombokgroupId>
<artifactId>lombokartifactId>
<optional>trueoptional>
dependency>
dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-maven-pluginartifactId>
plugin>
plugins>
build>
project>
# ======================== 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: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- 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: 0.0.0.0
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes:
#
# For more information, consult the zen discovery 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
# 切换目录
cd E:\Project\elasticsearch-6.5.0\bin
elasticsearch.bat
# 启动结果
[2019-10-21T14:37:21,301][INFO ][o.e.e.NodeEnvironment ] [d71csjX] using [1] data paths, mounts [[杞欢 (D:)]], net usable_space [74.8gb], net total_space [102gb], types [NTFS]
[2019-10-21T14:37:21,306][INFO ][o.e.e.NodeEnvironment ] [d71csjX] heap size [990.7mb], compressed ordinary object pointers [true]
[2019-10-21T14:37:21,364][INFO ][o.e.n.Node ] [d71csjX] node name derived from node ID [d71csjXIQaqc9SqVXm1FeA]; set [node.name] to override
[2019-10-21T14:37:21,365][INFO ][o.e.n.Node ] [d71csjX] version[6.5.0], pid[11940], build[default/zip/816e6f6/2018-11-09T18:58:36.352602Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_191/25.191-b12]
[2019-10-21T14:37:21,367][INFO ][o.e.n.Node ] [d71csjX] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -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=C:\Users\ADMINI~1\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, -Delasticsearch, -Des.path.home=D:\Project\elasticsearch-6.5.0, -Des.path.conf=D:\Project\elasticsearch-6.5.0\config, -Des.distribution.flavor=default, -Des.distribution.type=zip]
[2019-10-21T14:37:26,912][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [aggs-matrix-stats]
[2019-10-21T14:37:26,913][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [analysis-common]
[2019-10-21T14:37:26,914][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [ingest-common]
[2019-10-21T14:37:26,915][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [lang-expression]
[2019-10-21T14:37:26,917][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [lang-mustache]
[2019-10-21T14:37:26,918][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [lang-painless]
[2019-10-21T14:37:26,920][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [mapper-extras]
[2019-10-21T14:37:26,921][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [parent-join]
[2019-10-21T14:37:26,925][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [percolator]
[2019-10-21T14:37:26,928][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [rank-eval]
[2019-10-21T14:37:26,930][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [reindex]
[2019-10-21T14:37:26,931][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [repository-url]
[2019-10-21T14:37:26,933][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [transport-netty4]
[2019-10-21T14:37:26,935][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [tribe]
[2019-10-21T14:37:26,936][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-ccr]
[2019-10-21T14:37:26,937][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-core]
[2019-10-21T14:37:26,940][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-deprecation]
[2019-10-21T14:37:26,942][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-graph]
[2019-10-21T14:37:26,942][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-logstash]
[2019-10-21T14:37:26,944][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-ml]
[2019-10-21T14:37:26,947][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-monitoring]
[2019-10-21T14:37:26,948][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-rollup]
[2019-10-21T14:37:26,949][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-security]
[2019-10-21T14:37:26,950][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-sql]
[2019-10-21T14:37:26,951][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-upgrade]
[2019-10-21T14:37:26,952][INFO ][o.e.p.PluginsService ] [d71csjX] loaded module [x-pack-watcher]
[2019-10-21T14:37:26,956][INFO ][o.e.p.PluginsService ] [d71csjX] no plugins loaded
[2019-10-21T14:37:38,616][INFO ][o.e.x.s.a.s.FileRolesStore] [d71csjX] parsed [0] roles from file [D:\Project\elasticsearch-6.5.0\config\roles.yml]
[2019-10-21T14:37:40,293][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [d71csjX] [controller/14712] [Main.cc@109] controller (64 bit): Version 6.5.0 (Build 71882a589e5556) Copyright (c) 2018 Elasticsearch BV
[2019-10-21T14:37:41,392][DEBUG][o.e.a.ActionModule ] [d71csjX] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-10-21T14:37:42,074][INFO ][o.e.d.DiscoveryModule ] [d71csjX] using discovery type [zen] and host providers [settings]
[2019-10-21T14:37:43,816][INFO ][o.e.n.Node ] [d71csjX] initialized
[2019-10-21T14:37:43,817][INFO ][o.e.n.Node ] [d71csjX] starting ...
[2019-10-21T14:37:47,341][INFO ][o.e.t.TransportService ] [d71csjX] publish_address {
172.17.115.17:9300}, bound_addresses {
[::]:9300}
[2019-10-21T14:37:47,387][INFO ][o.e.b.BootstrapChecks ] [d71csjX] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-10-21T14:37:50,642][INFO ][o.e.c.s.MasterService ] [d71csjX] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {
d71csjX}{
d71csjXIQaqc9SqVXm1FeA}{
XwYtG8qXQGO1ZYAOCjd4KQ}{
172.17.115.17}{
172.17.115.17:9300}{
ml.machine_memory=17087959040, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-10-21T14:37:50,653][INFO ][o.e.c.s.ClusterApplierService] [d71csjX] new_master {
d71csjX}{
d71csjXIQaqc9SqVXm1FeA}{
XwYtG8qXQGO1ZYAOCjd4KQ}{
172.17.115.17}{
172.17.115.17:9300}{
ml.machine_memory=17087959040, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {
d71csjX}{
d71csjXIQaqc9SqVXm1FeA}{
XwYtG8qXQGO1ZYAOCjd4KQ}{
172.17.115.17}{
172.17.115.17:9300}{
ml.machine_memory=17087959040, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-10-21T14:37:51,979][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [d71csjX] Failed to clear cache for realms [[]]
[2019-10-21T14:37:52,162][INFO ][o.e.l.LicenseService ] [d71csjX] license [37a50ea7-2222-4e93-bc1a-de74bb762a5a] mode [basic] - valid
[2019-10-21T14:37:52,218][INFO ][o.e.g.GatewayService ] [d71csjX] recovered [1] indices into cluster_state
[2019-10-21T14:37:53,050][INFO ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [d71csjX] publish_address {
172.17.115.17:9200}, bound_addresses {
[::]:9200}
[2019-10-21T14:37:53,052][INFO ][o.e.n.Node ] [d71csjX] started
[2019-10-21T14:37:53,622][INFO ][o.e.c.r.a.AllocationService] [d71csjX] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[books][0]] ...]).
http://localhost:9200/
localhost:9200/_cat/health?v
localhost:9200/_cat/indices?v
/**
*
* @Author: hyacinth
* @Title: Books.java
* @Package com.xu.springboot.elasticsearch
* @Description: TODO:
* @Date: 2019年10月20日 下午8:40:02
* @Version V-1.0
* @Copyright: 2019 hyacinth
*
*/
package com.xu.springboot.elasticsearch;
import java.io.Serializable;
import org.springframework.data.elasticsearch.annotations.Document;
/**
* @Author: hyacinth
* @ClassName: Books
* @Description: TODO
* @Date: 2019年10月20日 下午8:40:02
* @Copyright: hyacinth
*/
@Document(indexName = "books", type = "info", shards = 1, replicas = 0)
public class Books implements Serializable {
/**
* @Fields serialVersionUID:TODO
* @Date 2019年8月17日 下午9:56:28
*/
private static final long serialVersionUID = -4201309328223793614L;
private String id;
private String name;
private String tag;
private String description;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
/**
*
* @Author: hyacinth
* @Title: BookSearchRepository.java
* @Package com.xu.springboot.elasticsearch
* @Description: TODO:
* @Date: 2019年10月20日 下午8:44:32
* @Version V-1.0
* @Copyright: 2019 hyacinth
*
*/
package com.xu.springboot.elasticsearch;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;
/**
* @Author: hyacinth
* @ClassName: BookSearchRepository
* @Description: TODO
* @Date: 2019年10月20日 下午8:44:32
* @Copyright: hyacinth
*/
@Component
public interface BookSearchRepository extends ElasticsearchRepository<Books,String> {
}
/**
*
* @Author: hyacinth
* @Title: BookSearchService.java
* @Package com.xu.springboot.elasticsearch
* @Description: TODO:
* @Date: 2019年10月20日 下午8:43:01
* @Version V-1.0
* @Copyright: 2019 hyacinth
*
*/
package com.xu.springboot.elasticsearch;
/**
* @Author: hyacinth
* @ClassName: BookSearchService
* @Description: TODO
* @Date: 2019年10月20日 下午8:43:01
* @Copyright: hyacinth
*/
public interface BookSearchService {
Object save(Books books);
Object findAllBook();
Object findByBookId(String id);
Object findByBookName(String name);
Object updateByBookId(Books books);
Object updateByBookName(Books books);
Object deleteByBookId(String id);
Object deleteByBookName(String name);
}
/**
*
* @Author: hyacinth
* @Title: BookSearchServiceImpl.java
* @Package com.xu.springboot.elasticsearch
* @Description: TODO:
* @Date: 2019年10月20日 下午8:43:34
* @Version V-1.0
* @Copyright: 2019 hyacinth
*
*/
package com.xu.springboot.elasticsearch;
import java.util.Optional;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.core.query.SearchQuery;
import org.springframework.stereotype.Service;
/**
* @Author: hyacinth
* @ClassName: BookSearchServiceImpl
* @Description: TODO
* @Date: 2019年10月20日 下午8:43:34
* @Copyright: hyacinth
*/
@Service
public class BookSearchServiceImpl implements BookSearchService{
@Autowired
private BookSearchRepository repository;
@Autowired
private ElasticsearchTemplate template;
@Override
public Object save(Books books) {
Books save = repository.save(books);
return save.toString();
}
@Override
public Object findAllBook() {
return repository.findAll();
}
@Override
public Object findByBookId(String id) {
return repository.findById(id);
}
@Override
public Object findByBookName(String name) {
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(QueryBuilders.matchPhraseQuery("name", name))
.build();
return template.queryForList(searchQuery, Books.class);
}
@Override
public Object updateByBookId(Books books) {
// TODO Auto-generated method stub
return null;
}
@Override
public Object updateByBookName(Books books) {
// TODO Auto-generated method stub
return null;
}
@Override
public Object deleteByBookId(String id) {
Optional<Books> books = repository.findById(id);
repository.deleteById(id);
return books;
}
@Override
public Object deleteByBookName(String name) {
// TODO Auto-generated method stub
return null;
}
}
/**
*
* @Author: hyacinth
* @Title: ElasticSearchController.java
* @Package com.xu.springboot.controler
* @Description: TODO:
* @Date: 2019年10月20日 下午10:22:59
* @Version V-1.0
* @Copyright: 2019 hyacinth
*
*/
package com.xu.springboot.controler;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xu.springboot.elasticsearch.BookSearchService;
import com.xu.springboot.elasticsearch.Books;
/**
* @Author: hyacinth
* @ClassName: ElasticSearchController
* @Description: TODO
* @Date: 2019年10月20日 下午10:22:59
* @Copyright: hyacinth
*/
@RestController
@RequestMapping("/es")
public class ElasticSearchController {
@Autowired
private BookSearchService service;
@RequestMapping("/save")
public Object save(String id) {
//http://127.0.0.1:8080/es/save?id=2
Books document=new Books();
document.setId(id);
document.setName(id+": 心如孤岛囚我终老 "+UUID.randomUUID().toString());
document.setTag("爱情");
document.setDescription(UUID.randomUUID().toString());
service.save(document);
List<Object> list=new ArrayList<Object>();
list.add("Success\t"+id);
list.add(service.findByBookId(id));
return list;
}
@RequestMapping("/getByBookId")
public Object getByBookId(String id) {
//http://127.0.0.1:8080/es/getByBookId?id=2
return service.findByBookId(id);
}
@RequestMapping("/getByBookName")
public Object getByBookName(String name) {
//http://127.0.0.1:8080/es/getByBookName?name=心如孤岛囚我终老
return service.findByBookName(name);
}
@RequestMapping("/deleteByBookId")
public Object deleteByBookId(String id) {
//http://127.0.0.1:8080/es/deleteByBookId?id=1
return service.deleteByBookId(id);
}
@RequestMapping("/findAllBook")
public Object findAllBook() {
//http://127.0.0.1:8080/es/findAllBook
return service.findAllBook();
}
}
package com.xu.springboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.9.RELEASE)
2019-10-21 14:55:58.211 INFO 1824 --- [ restartedMain] com.xu.springboot.Application : Starting Application on ZWJ0R16WWO114LL with PID 1824 (E:\SourceCode\Eclipse-2019-06\ElasticSearch\target\classes started by Administrator in E:\SourceCode\Eclipse-2019-06\ElasticSearch)
2019-10-21 14:55:58.218 INFO 1824 --- [ restartedMain] com.xu.springboot.Application : No active profile set, falling back to default profiles: default
2019-10-21 14:55:58.521 INFO 1824 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-10-21 14:55:58.521 INFO 1824 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-10-21 14:56:01.521 INFO 1824 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-10-21 14:56:01.774 INFO 1824 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 239ms. Found 1 repository interfaces.
2019-10-21 14:56:04.594 INFO 1824 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-10-21 14:56:04.782 INFO 1824 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-10-21 14:56:04.783 INFO 1824 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.26]
2019-10-21 14:56:05.432 INFO 1824 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-10-21 14:56:05.432 INFO 1824 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 6910 ms
2019-10-21 14:56:09.081 INFO 1824 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : no modules loaded
2019-10-21 14:56:09.083 INFO 1824 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
2019-10-21 14:56:09.084 INFO 1824 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2019-10-21 14:56:09.085 INFO 1824 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2019-10-21 14:56:09.085 INFO 1824 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.script.mustache.MustachePlugin]
2019-10-21 14:56:09.085 INFO 1824 --- [ restartedMain] o.elasticsearch.plugins.PluginsService : loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019-10-21 14:56:15.059 INFO 1824 --- [ restartedMain] o.s.d.e.c.TransportClientFactoryBean : Adding transport node : 127.0.0.1:9300
2019-10-21 14:56:17.718 INFO 1824 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2019-10-21 14:56:18.478 INFO 1824 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-10-21 14:56:21.377 INFO 1824 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-10-21 14:56:21.382 INFO 1824 --- [ restartedMain] com.xu.springboot.Application : Started Application in 24.713 seconds (JVM running for 26.128)
http://127.0.0.1:8080/es/save?id=2
http://127.0.0.1:8080/es/deleteByBookId?id=1
http://127.0.0.1:8080/es/findAllBook