ElasticSearch 下载
ES的官方下载地址:https://www.elastic.co/downloads/elasticsearch,大家可以按照自己的操作系统选择合适版本,目前的最新版本是6.4。
ElasticSearch 运行
我的开发环境是MAC,解压压缩包,在终端输入ls命令,会有以下文件目录:
elasticsearch elasticsearch-service.bat
elasticsearch-certgen elasticsearch-setup-passwords
elasticsearch-certgen.bat elasticsearch-setup-passwords.bat
elasticsearch-certutil elasticsearch-sql-cli
elasticsearch-certutil.bat elasticsearch-sql-cli-6.4.0.jar
elasticsearch-cli elasticsearch-sql-cli.bat
elasticsearch-cli.bat elasticsearch-syskeygen
elasticsearch-croneval elasticsearch-syskeygen.bat
elasticsearch-croneval.bat elasticsearch-translog
elasticsearch-env elasticsearch-translog.bat
elasticsearch-env.bat elasticsearch-users
elasticsearch-keystore elasticsearch-users.bat
elasticsearch-keystore.bat elasticsearch.bat
elasticsearch-migrate x-pack
elasticsearch-migrate.bat x-pack-env
elasticsearch-plugin x-pack-env.bat
elasticsearch-plugin.bat x-pack-security-env
elasticsearch-saml-metadata x-pack-security-env.bat
elasticsearch-saml-metadata.bat x-pack-watcher-env
elasticsearch-service-mgr.exe x-pack-watcher-env.bat
elasticsearch-service-x64.exe
可以看到各种文件格式,本机在bin目录下运行
./elasticsearch
如果是windows则
./elasticsearch.bat
如果作为守护进程运行,则需要添加参数 -d
./elasticsearch -d
测试是否运行成功
输入测试url
curl 'http://localhost:9200/?pretty'
如果正常的话,会有以下结果:
{
"name" : "r9uUfUB",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "E7L452raSgOC6w1CnClnHg",
"version" : {
"number" : "6.4.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "595516e",
"build_date" : "2018-08-17T23:18:47.308994Z",
"build_snapshot" : false,
"lucene_version" : "7.4.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
使用kibana sense
虽然sense不是必备的,但是增强了与es的交互体验,先下载kibana:https://www.elastic.co/downloads/kibana
解压安装过程跟es是一样的,目前的版本6.4集成了sense,直接在运行,启动成功后在浏览器键入地址:localhost:5601,会出现以下页面:
总结
以上是ElasticSearch的安装,谢谢。