linux下安装es+kibana

1、下载安装包

##下载es安装包##
wget https://repo.huaweicloud.com/elasticsearch/7.9.3/elasticsearch-7.9.3-linux-x86_64.tar.gz

##下载kibana安装包##
wget https://artifacts.elastic.co/downloads/kibana/kibana-7.9.3-linux-x86_64.tar.gz

2、安装elasticsearch

  • 解压安装包

    tar -zxvf elasticsearch-7.9.3-linux-x86_64.tar.gz
    mv elasticsearch-7.9.3 elasticsearch
    
  • 创建elasticsearch用户

    useradd es
    chown -R es:es elasticsearch
    
  • 修改配置文件

    cd elasticsearch
    vim /config/elasticsearch.yml
    
    ##配置文件内容如下##
    cluster.name: es-app
    node.name: node-1
    network.host: 192.168.48.48
    http.port: 9200
    discovery.seed_hosts: ["192.168.48.48"]
    cluster.initial_master_nodes: ["node-1"]
    

3、启动elasticsearch

su es

./bin/elasticsearch -d

4、查看是否启动成功

浏览器打开http://192.168.48.48:9200/

显示

{
  "name" : "node-1",
  "cluster_name" : "es-app",
  "cluster_uuid" : "XouSqarsT8a8nZYUK90Bxw",
  "version" : {
    "number" : "7.9.3",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "c4138e51121ef06a6404866cddc601906fe5c868",
    "build_date" : "2020-10-16T10:36:16.141335Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

5、安装和启动kibana

  • 解压安装包

    tar -zxvf kibana-7.9.3-linux-x86_64.tar.gz
    
    mv kibana-7.9.3-linux-x86_64 kibana
    
    chown -R es:es kibana
    
  • 修改配置文件

    cd kibana
    vim ./config/kibana.yml
    
    ##文件内容##
    server.port: 5601
    server.host: "192.168.48.48"
    elasticsearch.hosts: ["http://192.168.48.48:9200"]
    
  • 启动kibana

    su es
    
    ##后台启动kibana##
    nohup ./bin/kibana > kibana.log &
    
  • 浏览器打开kibana

    http://192.168.48.48:5601
    

6、遇到问题

  • elasticsearch启动报错

    ....
    [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
    [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    
    
    #######解决方法#######
    su root
    vi /etc/security/limits.conf
    
    ###添加以下内容,其中es为用户名###
    es hard nofile 65535
    es soft nofile 65535
    
    ##修改文件##
    vi /etc/sysctl.conf 
    
    ##添加下面内容##
    vm.max_map_count = 262144
    
    ##查询配置##
    sysctl -p
    
    ##再切换用户,重新启动es###
    su es
    
posted @ 2023-05-07 17:32  linmt  阅读(356)  评论(0编辑  收藏  举报