下载安装包的地址:https://www.elastic.co/downloads/past-releases/elasticsearch-2-4-0
上传到服务器之后解压:
tar -zxvf elasticsearch-2.4.0.tar.gz
创建用户及授权(root账号下面创建一个启动es的账号,因为root默认不能启动为了安全性)sudo useradd elsearch
chown -R elsearch:elsearch /usr/local/elasticsearch-2.4.0
config目录下 elasticsearch.yml 修改network.host参数为0.0.0.0,这样别的IP就可以访问
bin目录启动服务,-d表示后台执行,获取更多参数信息 --help
./elasticsearch -d
验证
curl localhost:9200 或者 curl 127.0.0.1:9200
出现了以下表示成功: