zoukankan      html  css  js  c++  java
  • elastic安装,简单配置

    安装elasticsearch:

    # 下载安装包
    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-darwin-x86_64.tar.gz
    # 解压es
    tar -xzf elasticsearch-7.2.0-darwin-x86_64.tar.gz
    # 修改目录
    mv elasticsearch-7.2.0 /usr/local/
    # 创建软连接
    ln -s /usr/local/elasticsearch-7.2.0 /usr/local/elasticsearch
    # 创建es执行用户
    useradd es
    # 修改目录 权限
    chown -R es:es /usr/local/elasticsearch-7.2.0
    chown -R es:es /usr/local/elasticsearch
    

    修改elasticsearch配置:

    • 修改配置文件:config/elasticsearch.yml
    # ---------------------------------- Cluster -----------------------------------
    # Use a descriptive name for your cluster:
    cluster.name: qx-car
    # ------------------------------------ Node ------------------------------------
    # Use a descriptive name for the node:
    node.name: node-1
    # ----------------------------------- Paths ------------------------------------
    # Path to directory where to store the data (separate multiple locations by comma):
    path.data: /data/service/elasticsearch
    # Path to log files:
    path.logs: /data/logs/elasticsearch
    # ----------------------------------- Memory -----------------------------------
    # Lock the memory on startup:
    bootstrap.memory_lock: true
    # ---------------------------------- Network -----------------------------------
    # Set the bind address to a specific IP (IPv4 or IPv6):
    network.host: 172.18.63.171
    # Set a custom port for HTTP:
    http.port: 9200
    # --------------------------------- Discovery ----------------------------------
    # Bootstrap the cluster using an initial set of master-eligible nodes:
    cluster.initial_master_nodes: ["node-1"]
    
    • 修改配置文件:config/jvm.options
    # 内存修改
    -Xms16g
    -Xmx16g
    
    • 创建目录
    # 创建 data目录
    mkdir /data/service/elasticsearch
    # 创建 log目录
    mkdir /data/logs/elasticsearch
    # 修改目录权限
    chown -R es:es /data/service/elasticsearch
    chown -R es:es /data/logs/elasticsearch
    

    修改系统配置:

    #  关闭交换分区,防止内存置换降低性能。 将/etc/fstab 文件中包含swap的行注释掉
    sed -i '/swap/s/^/#/' /etc/fstab
    swapoff -a
    # 单用户可以打开的最大文件数量,可以设置为官方推荐的65536或更大些
    echo "* - nofile 655360" >> /etc/security/limits.conf
    # 单用户线程数调大
    echo "* - nproc 131072" >> /etc/security/limits.conf
    # 设置es内存锁无限制
    echo "es soft memlock unlimited" >> /etc/security/limits.conf
    echo "es hard memlock unlimited" >> /etc/security/limits.conf
    # 单进程可以使用的最大map内存区域数量
    echo "vm.max_map_count = 655360" >> /etc/sysctl.conf
    # 参数修改立即生效
    sysctl -p
    

    启动与关闭:

    # 切换账号
    su es
    # 启动es
    /usr/local/elasticsearch/bin/elasticsearch -d -p pid
    # 关闭es
    pkill -F /usr/local/elasticsearch/pid
    

    参考文章:

  • 相关阅读:
    修改科目的字段状态组-OBC4
    采购收货-对于物料,在工厂、库存地点中不存在物料主数据
    采购收货
    新建工厂
    采购订单收货提示,T169P表不存在
    维护工厂日历
    开始创建物料没有选择会计视图,需要怎么维护
    拓端数据tecdat|R语言分布滞后线性和非线性模型(DLMs和DLNMs)分析时间序列数据
    拓端数据tecdat|R语言分布滞后非线性模型(DLNM)研究发病率,死亡率和空气污染示例
    拓端数据tecdat|R语言中实现广义相加模型GAM和普通最小二乘(OLS)回归
  • 原文地址:https://www.cnblogs.com/iamdoufu/p/11303601.html
Copyright © 2011-2022 走看看