es 6.3 .tar.gz 安装

os: centos7.4
es: 6.3.1
java:oracle jdk 1.8.0_131

es 全称是 elasticsearc,具有超高性能。Elasticsearch、Logstash、Kibana 简称 ELK

安装 oracle jdk 1.8

es 6.3.0的文档强烈建议实用 oracle JDK version 1.8.0_131,centos 7.4 默认实用的是 openjdk 1.8.0_131,索引要简单替换下。
oracle jdk 下载地址:
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html

# java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

# which java
/usr/bin/java

# ls -l /usr/bin |grep -i java
lrwxrwxrwx.   1 root root         22 Jun 20 10:38 java -> /etc/alternatives/java
lrwxrwxrwx.   1 root root         24 Jun 20 10:43 javaws -> /etc/alternatives/javaws
-rwxr-xr-x.   1 root root       2672 Nov  6  2016 javaws.itweb
# cd /usr
# mkdir oracle-jdk-8u131
# cd /usr/oracle-jdk-8u131
# rz
# tar -zxvf ./jdk-8u131-linux-x64.tar.gz
# ls -l
total 181192
drwxr-xr-x 8   10  143       255 Mar 15  2017 jdk1.8.0_131
-rw-r--r-- 1 root root 185540433 Jul  9 15:51 jdk-8u131-linux-x64.tar.gz

创建 es 用户

# groupadd -g 5000 es
# useradd -g es -u 5000 es

安装 es

# vi /etc/profile
export JAVA_HOME=/usr/oracle-jdk-8u131/jdk1.8.0_131
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
# source /etc/profile
# cd /usr
# mkdir elasticsearch-6.3.1
# chown -R es:es ./elasticsearch-6.3.1
# su - es

$ cd /usr/elasticsearch-6.3.1
$ curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1.tar.gz
$ tar -zxvf elasticsearch-6.3.1.tar.gz
$ cd elasticsearch-6.3.1/bin
$ ./elasticsearch

注意观察日志输出,几乎所有的程序,日志都是需要重点关注的。
此时启动的es是单节点模式,不是集群模式。

查看状态

$ curl http://localhost:9200/
{
  "name" : "y_D-uk-",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "63bYu-v6QDWeDu6S8Ep0qA",
  "version" : {
    "number" : "6.3.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "eb782d0",
    "build_date" : "2018-06-29T21:59:26.107521Z",
    "build_snapshot" : false,
    "lucene_version" : "7.3.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

$ curl -X GET "localhost:9200/_cat/health?v"
epoch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1531125365 16:36:05  elasticsearch green           1         1      0   0    0    0        0             0                  -                100.0%

$ curl -X GET "localhost:9200/_cat/nodes?v"
ip        heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
127.0.0.1           13          97   0    0.00    0.01     0.05 mdi       *      y_D-uk-


es 的安装就先这样吧,已经够简单了。

后面陆续有使用记录,毕竟es是拿来用的,不是安装好放在那。

参考:
https://www.elastic.co/cn/
https://www.elastic.co/guide/index.html
https://www.elastic.co/webinars/getting-started-elasticsearch?baymax=default&elektra=docs&storm=top-video

https://www.elastic.co/blog/elasticsearch-6-3-0-released
https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
https://www.elastic.co/downloads/elasticsearch

https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html

posted @ 2018-07-09 18:32  peiybpeiyb  阅读(240)  评论(0编辑  收藏  举报