Windows下安装及简单使用Elasticsearch和kibana
1.安装解压 Elasticsearch https://www.elastic.co/cn/downloads/elasticsearch 需要先安装jdk支持
kibana : https://www.elastic.co/cn/downloads/
2.启动ES 管理员运行\Elasticsearch\elasticsearch-6.2.2\elasticsearch-6.2.2\bin目录下的 elasticsearch.bat 文件
3.启动kibana 管理员运行kibana-6.2.2-windows-x86_64\kibana-6.2.2-windows-x86_64\bin目录下的 kibana.bat 文件
4.访问 es http://localhost:9200/
5.访问kibana http://localhost:5601 通过kibana操作es
6.spring boot 整合Elasticsearch 步骤
1.jar包
<!--spring 整合 elasticSearch--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId> </dependency>
2.配置yml ,我的是本地连接 None of the configured nodes are available节点名报错
1.连接ip错误
2.修改ES下config文件下的 elasticsearch.yml文件 17行 cluster.name: elasticsearch 跟你定义的节点名相同 默认 值 elasticsearch
#=====ElasticSearch start====== spring.data.elasticsearch.cluster-name=elasticsearch spring.data.elasticsearch.cluster-nodes=127.0.0.1:9300 #=====ElasticSearch end======
3.编辑实体 Es使用 创建文档-->索引-->类型-->id @Document配置文档 indexName->索引 type->类型
4.继承ES类CrudRepository org.springframework.data.repository.CrudRepository
启动类加ES 扫包 @EnableElasticsearchRepositories(basePackages = "com.cnczsq.mall.elephant.v1.elasticsearch")
5.Controller测试接口