- $ sudo apt-get update
- $ sudo apt-get upgrade
- $ sudo add-apt-repository ppa:webupd8team/java
- $ sudo apt-get update
- $ sudo apt-get install oracle-java7-installer
OR
加入 Elasticsearch 官方源后安装 elasticsearch:
- wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Save the repository definition to /etc/apt/sources.list.d/elasticsearch-2.x.list:
- echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
- $ sudo apt-get update
- $ sudo apt-get install elasticsearch
加入到系统启动文件并启动 elasticsearch 服务,用 curl 测试一下安装是否成功:
- $ sudo update-rc.d elasticsearch defaults 95 1
- $ sudo /etc/init.d/elasticsearch start
- $ curl -X GET 'http://localhost:9200'
{
"name" : "Khonshu",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.1.1",
"build_hash" : "40e2c53a6b6c2972b3d13846e450e66f4375bd71",
"build_timestamp" : "2015-12-15T13:05:55Z",
"build_snapshot" : false,
"lucene_version" : "5.3.1"
},
"tagline" : "You Know, for Search"
}
"name" : "Khonshu",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.1.1",
"build_hash" : "40e2c53a6b6c2972b3d13846e450e66f4375bd71",
"build_timestamp" : "2015-12-15T13:05:55Z",
"build_snapshot" : false,
"lucene_version" : "5.3.1"
},
"tagline" : "You Know, for Search"
}
Elasticsearch 的集群和数据管理界面 Marvel 非常赞,可惜只对开发环境免费,如果这个工具也免费就无敌了,安装很简单,完成后重启服务访问 http://IP:9200/_plugin/marvel/ 就可以看到界面:
没有评论