美文网首页
centos搭建es

centos搭建es

作者: 就叫basi | 来源:发表于2020-11-16 17:29 被阅读0次

使用命令上传本地文件到centos

scp 本地文件路径 username@ip:/path
输入密码完成

  basi@basideMacBook-Pro ~ % scp /Users/basi/Downloads/elasticsearch-7.10.0-linux-x86_64.tar.gz  root@192.168.33.11:/es

给用户分配文件权限

useradd es    //添加用户
 chown -R  用户名:组名  path

 -R 以递归的形式处理指定目录及其子目录下所有的文件

解压gzip文件

tar -zxvf 文件
-zxvf 解压gzip文件
-xvf  解压zip文件

es启动失败

es启动失败.png
step1:
[root@localhost config]# cd /
[root@localhost /]# vi  /etc/security/limits.conf 
补充以下
 *               soft    nofile          65536
 *               hard    nofile          65536
 *               soft    nproc           4096
 *               hard    nproc           4096

step2:
[root@localhost security]# vi  /etc/sysctl.conf 
补充以下
vm.max_map_count=262144

step3:
[root@localhost security]# sysctl -p
vm.max_map_count = 262144

centos7关闭防火墙

如果发现在centos上能curl到es服务,但是在本地确访问不通,就看看centos的防火墙吧

systemctl stop firewalld    //  关闭防火墙
systemctl start firewalld    //开启防火墙
systemctl status firewalld    //查看防火墙状态

开放端口
step1:
[root@localhost /]# systemctl start firewalld
step2:
[root@localhost /]# firewall-cmd --add-port=9200/tcp --permanent
success  //永久性的开放9200端口
step3:
[root@localhost /]# firewall-cmd --reload  //重载生效刚才的端口设置
success

新建kibana文件夹,和es文件夹同一级,解压安装,进入kibana的config目录中,修改kibana.yml

kibana.yml
kibana.yml

使用非root账户启动kibana即可

centos7设置当地时间

  [root@localhost logs]# timedatectl     //读取时间
      Local time: 一 2020-11-23 16:15:49 CST
  Universal time: 一 2020-11-23 08:15:49 UTC
        RTC time: 一 2020-11-23 08:15:49
        Timezone: Asia/Shanghai (CST, +0800)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
[root@localhost logs]# timedatectl set-timezone Asia/Shanghai    //设置时间
[root@localhost logs]# 

3台机器的es集群

es1:192.168.33.11
es2:192.168.33.12
es3:192.168.33.13

elasticsearch.yml中的配置

    
      # Use a descriptive name for your cluster:
         //集群名称
        cluster.name: basi_es
      # Use a descriptive name for the node:
      # Use a descriptive name for the node:
        node.name: es1
        //指定该节点是否有资格被选举成为master结点,默认是true,如果原来的master宕机会重新选 举新的master。
        node.master: true
        //指定该节点是否存储索引数据,默认为true。
        node.data: true
        //单机允许的最大存储结点数,通常单机启动一个结点建议设置为1,开发环境如果单机启动多个节 点可设置大于1。
        node.max_local_storage_nodes: 3
      # Path to directory where to store the data (separate multiple locations by comma):
        path.data: /data
      # Path to log files:
        path.logs: /logs
      # Set the bind address to a specific IP (IPv4 or IPv6):
        network.host: 192.168.33.11
      # Set a custom port for HTTP:
        //设置对外服务的http端口,默认为9200。
        http.port: 9201
        //集群结点之间通信端口
        transport.tcp.port: 9700
        //集群发现
        discovery.seed_hosts: ["192.168.33.11:9700","192.168.33.12:9800","192.168.33.13:9900"]
        //es7.x 之后新增的配置,初始化一个新的集群时需要此配置来选举master
        cluster.initial_master_nodes: ["es1","es2","es3"]  

分别ssh每台机器,开放9021,9022,9023,9700,9800,9900端口!
访问es心跳 http://192.168.33.11:9201/_cat/health?v

三哥节点的es集群完成

配置kibana

[root@localhost /]# cd kibana/kibana-7.10.0-linux-x86_64/
[root@localhost kibana-7.10.0-linux-x86_64]# cd config/
[root@localhost config]# ls
kibana.yml  node.options
[root@localhost config]# vi kibana.yml 

# The URLs of the Elasticsearch instances to use for all your queries.
  elasticsearch.hosts: ["http://192.168.33.11:9201","http://192.168.33.12:9202","http://192.168.33.13:9203"]

# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value must be a positive integer.
  elasticsearch.requestTimeout: 99999

启动kibana,访问http://192.168.33.11:5601/观察堆栈检测。


相关文章

  • centos搭建es

    使用命令上传本地文件到centos scp 本地文件路径 username@ip:/path输入密码完成 给用户...

  • centos7搭建ElasticSearch环境

    linux环境: centos7es版本:7.0.0java版本:1.8搭建filebeat安装logstash ...

  • ES搭建

    本次搭建的为两台ES,一主一从,环境为CentOS 7.6.1810;java version 1.8.0_181...

  • ElasticSearch集群搭建

    单台机器搭建3节点ES集群,本文采用elasticsearch7.2做为安装版本,linux 为centos 。理...

  • 五、kafka集群搭建

    本系列目录: 一、CentOS集群搭建(1)--CentOS安装篇 一、CentOS集群搭建(2)--CentOS...

  • 三、Hive搭建(不需要搭建集群)

    本系列目录: 一、CentOS集群搭建(1)--CentOS安装篇 一、CentOS集群搭建(2)--CentOS...

  • 四、Zookeeper集群搭建

    本系列目录: 一、CentOS集群搭建(1)--CentOS安装篇 一、CentOS集群搭建(2)--CentOS...

  • 六、Spark集群搭建

    本系列目录: 一、CentOS集群搭建(1)--CentOS安装篇 一、CentOS集群搭建(2)--CentOS...

  • 一、CentOS集群搭建(3)

    本系列目录: 一、CentOS集群搭建(1)--CentOS安装篇 一、CentOS集群搭建(2)--CentOS...

  • 二、Hadoop集群搭建

    本系列目录: 一、CentOS集群搭建(1)--CentOS安装篇 一、CentOS集群搭建(2)--CentOS...

网友评论

      本文标题:centos搭建es

      本文链接:https://www.haomeiwen.com/subject/ldszbktx.html