• Contos 7.5下搭建elasticsearch-7.6.2


    linux环境下搭建ES

    一,下载地址

    Es下载地址:https://www.elastic.co/cn/downloads/elasticsearch

    Kibana:https://www.elastic.co/cn/downloads/kibana

    ES的版本要和Kibana的版本对应

     

    本次环境搭建教程是版本7.6.2

     

    二,环境搭建

    2.1配置java开发环境

    Java的开发环境最好是1.8以上的

    2.2 手动安装elasticsearch和Kibana

    2.2.1 将下载好的ES和Kibana解压

    我是将文件放到了/usr/local/elasticsearch中,以此解压ES和kibana的压缩包。

    解压指令:

    tar -zxvf elasticsearch-7.6.2-linux-x86_64.tar.gz
    
    tar -zxvf kibana-7.6.2-linux-x86_64.tar.gz

    解压后得到两个文件夹

     

    2.2.2  elasticsearch-7.6.2中的文件

    工欲善其事必先利其器,我们先熟悉es中的文件,以便以后的学习和维护操作等等。

    ①bin目录放的是启动文件

    ②config目录为配置文件

    ③lib相关的jar包

    ④plugins目录中为插件文件,比如IK中文分析器

    ⑤logs 自己创建的,存放日志文件

    ⑥data 自己创建的,存放数据的地方

    熟悉了目录后,我们了解一下config下的配置文件。

    主要的配置文件有

    ①elasticsearch.yml es的配置文件

    ②jvm.options jvm的配置文件

    ③log4j2.properties 日志配置文件

    2.2.3配置文件详解

    ①elasticsearch.yml

    cluster.name: my-application
    
    node.name: node-1
    
    path.data: /usr/local/elasticsearch/elasticsearch-7.6.2/data
    
    path.logs: /usr/local/elasticsearch/elasticsearch-7.6.2/logs
    
    network.host: 0.0.0.0
    
    http.port: 9200
    
    cluster.initial_master_nodes: ["node-1"]

    放开这些注释,

    单机,node.name为node-1,

    默认端口为9200,

    nework.host修改为0.0.0.0,其他网络可以对es进行访问;

    ②jvm.options

    ES比较吃内存,配置的内存越高越爽,条件原因,设置1G

    2.2.3 启动ES

    创建ES用户

    useradd es
    
    chown -R es /usr/local/elasticsearch/elasticsearch-7.6.2

    启动ES

    su es
    cd /usr/local/elasticsearch/elasticsearch-7.6.2/bin
    ./elasticsearch

    启动成功

    2.2.4常见问题

    ①防火墙问题:

    如果没有开放9200端口

    firewall-cmd --zone=public --add-port=9200/tcp --permanent
    
    firewall-cmd --reload

    ②max virtual memory areas vm.maxmapcount [xxxxx] is too low

    vim /etc/sysctl.conf

    vm.max_map_count=262144然后sysctl -p生效

    2.3 Kibana的安装

    修改kibana的配置文件

    server.port: 5601
    
    server.host: "0.0.0.0"
    
    elasticsearch.hosts: ["http://localhost:9200"]

    启动

    cd /usr/local/elasticsearch/kibana-7.6.2/bin
    
    ./kibana
  • 相关阅读:
    solr 简要笔记
    JQuery select 编程时选中原有的值
    java设计模式图
    java设计模式
    qq空间微博等更多社交平台分享
    API调用开发demo
    fastJson
    小程序开发
    史上最全的机器学习资料(上)
    大数据”学习资源(下)
  • 原文地址:https://www.cnblogs.com/invban/p/12832868.html
Copyright © 2020-2023  润新知