es初步搭建

1.es tar包传至linux上 并解压

tar -zxvf elasticsearch-7.4.0-linux-x86_64.tar.gz 

 

2.新建用户 

useradd xxxname

passwd xxxpw

 

3.在root用户下将解压包的路径授权给新建的用户

chown -R xxxname:xxxpw 路径

 

4.配置解压目录下config的elasticsearch.yml配置文件

其中cluster.name: 配置集群名称

  node.name:   集群中这台服务器节点名称

  network.host: 允许哪个ip访问集群 0.0.0.0表示允许所有外网访问

  http.prot: es的端口

  cluster.inital_master_nodes :初始化新集群时选举master

 

5.新用户可创建文件及内存太小 切换到root用户 配置下

打开/etc/security/limits.conf

#末尾添加以下内容

用户名 soft nofile 65536

用户名 hard nofile 65536

 

(没找到这个文件)

打开/etc/security/limits.d/20-nproc.conf

#末尾添加以下内容

用户名 soft nofile 65536

用户名 hard nofile 65536

 

#虚拟内存 

打开/etc/sysctl.conf添加

vm.mas_map_count=655360

 

最后命令行跑下sysctl -p 为重新加载

 

6.启动es

在es的bin中跑下elasticsearch

 

posted @ 2020-07-19 09:59  小白小白小白小白  阅读(144)  评论(0编辑  收藏  举报