Ubuntu 安装elasticsearch

一、工具:ubuntu20.04 + elasticsearch-7.9.1 + jdk1.8

二、下载与上传elasticsearch

三、安装elasticsearch

       注意root用户下将es拥有者改为非root: chown -R es:es ./elasticsearch

四、配置elasticsearch

    a. 切换到elasticsearch config 目录,修改elasticsearch.yaml,修改的有:

    

# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.

# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["node-1"]

 

    b. 更改系统内存,如果不该elasticsearch 启动会报

    max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

    更改方法如下:

    1. root 用户下:sudo vim /etc/sysctl.conf

     2.在末尾添加 vm.max_map_count=655360

     3. sudo sysctl -p

五、要以非root用户启动

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值