在Centos 6.x上安装Elasticsearch的步骤备忘录
安装 Elasticsearch
将以下内容翻译成中文并做笔记:
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
安装JAVA
# パッケージ検索
yum search openjdk
# install
yum install -y java-1.X.X-openjdk.x86_64
# 確認
java -version
安装 Elasticsearch。
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
cat << EOS > /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=https://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
EOS
yum install -y elasticsearch
/etc/init.d/elasticsearch start
chkconfig --add elasticsearch
Elasticsearch 配置
vim /etc/elasticsearch/elasticsearch.yml
++ network.host: 192.168.0.XXX
请访问以下网址:http://192.168.5.191:9200/
{
"name" : "Hussar",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.2.1",
"build_hash" : "d045fc29d1932bce18b2e65ab8b297fbf6cd41a1",
"build_timestamp" : "2016-03-09T09:38:54Z",
"build_snapshot" : false,
"lucene_version" : "5.4.1"
},
"tagline" : "You Know, for Search"
}
其他
数据和日志默认情况下似乎位于下述位置。
-
- /usr/share/elasticsearch
-
- logs /var/log/elasticsearch
-
- data /var/lib/elasticsearch
- conf /etc/elasticsearch