"Elasticsearch is a distributed, RESTful style search engine and data analysis, to solve a variety of use cases are emerging out as the core of Elastic Stack, which is centrally store your data to help you find expected and unexpected situation. "this album describes the installation and use of elasticsearch.
1, environmental constraints
- win10 64 Wei
- elasticsearch-6.2.1
- jdk1.8 4 Wei
nodejs12.16
2, the premise constraint software download
Download:
https://www.elastic.co/cn/downloads/elasticsearch
premise constraint: proficient use git to download the code from github
https://www.jianshu.com/p/969ae76cdb4d3, steps
3.1, install and start the service elasticsearch
- Decompression
Note: The author is decompressed to the D: \ soft, the reader is set according to their actual situation, extract to the C drive Note that permissions issues - Set environment variables, adding the system environment variables:
ES_HOME=D:\soft\elasticsearch-6.2.1
ES_PATH_CONFIG=D:\soft\elasticsearch-6.2.1\config
PATH=%PATH%;%ES_HOME%\bin
- 修改 elasticsearch.yml
#配置es的集群名称,默认是elasticsearch,es会自动发现在同一网段下的es,如果在同一网段下有多个集群,就可以用这个属性来区分不同的集群
cluster.name: wanho
#节点名,默认随机指定一个name列表中名字,该列表在es的jar包中config文件夹里name.txt文件中
node.name: class138
#设置访问ip
network.host: 0.0.0.0
#设置http端口
http.port: 9200
#设置tcp端口
transport.tcp.port: 9300
#指定该节点是否有资格被选举成为node,默认是true,es是默认集群中的第一台机器为master,如果这台机挂了就会重新选举master。
node.master: true
#指定该节点是否存储索引数据,默认为true
node.data: true
#设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点
discovery.zen.minimum_master_nodes: 1
bootstrap.memory_lock: false
node.max_local_storage_nodes: 1
#设置索引数据的存储路径
path.data: C:\Program Files\elasticsearch-6.2.1\data
#设置日志文件的存储路径
path.logs: C:\Program Files\elasticsearch-6.2.1\logs
Note: Be sure to remove the above comments in Chinese
- Start elasticsearch
enter D: \ soft \ elasticsearch-6.2.1 \ bin, double-click elasticsearch.bat
command-line serial no error, into a state that started successfully:
- Test
input in the browser: HTTP: // localhost: 9200, the following states namely successful start
3.2, plug mounting head, for visual management
- Installation nodesjs and CNPM
https://www.jianshu.com/p/eb4d9e132f62 - And downloaded from github head start
cd D:\soft\elasticsearch-6.2.1
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
cnpm install
cnpm run start
At this visit http: // localhost: 9100, could not find a cross-domain error.
- To solve cross-domain configuration
add the following in elasticsearch.yml in, and reboot
http.cors.enabled: true
http.cors.allow‐origin: /.*/
Again go to http: // localhost: 9100, the following interface, to solve cross-domain success:
These are the installation process elasticsearch and visualization plug-in.