centos7 elasticserch 检索框架 安装篇

Posted 粪乧

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 elasticserch 检索框架 安装篇相关的知识,希望对你有一定的参考价值。

前方高能!
起跑前请先安装jdk!!!! 感谢看官合作.

创建elsearch新用户

由于安全性考虑 elasticsearch只能用非root启动,这里我创建了一个叫elsearch的用户

# useradd elsearch                       
# passwd elsearch

下载elasticsearch 解压并运行elasticsearch

# wget https://artifacts.elastic.co/downloads/
# elasticsearch/elasticsearch-6.1.1.zip
# wget https://artifacts.elastic.co/downloads/
# elasticsearch/elasticsearch-6.1.1.zip.sha512
# shasum -a 512 -c elasticsearch-6.1.1.zip.sha512
# unzip elasticsearch-6.1.1.zip
# cd elasticsearch-6.1.1/

修改访问elasticsearch的IP及端口

vim /usr/java/elasticsearch/config/elasticsearch.yml

找到如下代码段,并取消network.host及http.port所在行的注释,修改IP及端口

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
# 虚拟机本地访问可修改为 机器的本地ip 例如 192.168.0.151
# 0.0.0.0 为所有ip均可访问
network.host: 0.0.0.0  
# 
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>

直接运行 bin/elasticsearch 文件启动 elasticsearch

./elasticsearch

如果你稳得像铁板一样 一切顺利
http://192.168.0.151:9200 访问这个地址数据显示为


  "name" : "fYvui2i",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "OGL4awq7SM2BE2yGBdSZag",
  "version" : 
    "number" : "6.1.1",
    "build_hash" : "bd92e7f",
    "build_date" : "2017-12-17T20:23:25.338Z",
    "build_snapshot" : false,
    "lucene_version" : "7.1.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  ,
  "tagline" : "You Know, for Search"

如果不幸遇到问题那咱们就直接来解决吧!

以上是关于centos7 elasticserch 检索框架 安装篇的主要内容,如果未能解决你的问题,请参考以下文章

ElasticSearch

elasticserch Terms Set Query 查询 put delete

Elasticserch学习之查询字符串

k8s集群日志收集

Linux里面ELK作用是啥?

ElasticSearch