ElasticSearch学习-centos下安装

1.安装java运行环境(jre)

  //这里我安装了jdk 其实只需要安装jre就可以了

0)cd /usr;mkdir /usr/java; cd java

1)wget http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-i586.tar.gz 

   (下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

2) tar xvf jdk-8u73-linux-i586.tar.gz

3) vim /etc/profile

  ElasticSearch学习-centos下安装_第1张图片

4)source /etc/profile (使环境变量立即生效)

2.ElasticSearch下载运行

0)cd /opt

1)wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.2.0/elasticsearch-2.2.0.tar.gz --no-check-certificate

1)tar xvf elasticsearch-2.2.0.tar.gz

2) cd elasticsearch-2.2.0

3)./bin/elasticsearch -d

补充:

  以root用户运行会出现以下异常:

[2015-06-10 08:41:56,905][WARN ][bootstrap ] jvm uses the client vm, make sure to run `java` with the server vm for best performance by adding `-server` to the command line
Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

解决方案:

创建elsearch用户组及elsearch用户

groupadd elsearch

useradd elsearch -g elsearch -p elasticsearch

3.验证是否正常

ElasticSearch学习-centos下安装_第2张图片

   

转载于:https://www.cnblogs.com/sanshuiqing/p/5190686.html

你可能感兴趣的:(ElasticSearch学习-centos下安装)