elasticserach

1、下载地址:https://www.elastic.co/cn/downloads/elasticsearch
2、下载完成后上传到目标服务器

// An highlighted block
tar -zxvf elasticsearch-7.8.0-linux-x86_64.tar.gz
mv elasticsearch-7.8.0 /usr/local
cd elasticsearch-7.8.0/config
vim elasticsearch.yml

修改elasticsearch.yml

//修改配置文件中如下内容
cluster.name: wshop-elasticserach
node.name: es-node1
path.data: /usr/local/elasticsearch-7.8.0/data
path.logs: /usr/local/elasticsearch-7.8.0/logs
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: [“es-node1”]
//同在elasticserach.yml文件中,在network最后加两行,开启跨域
http.cors.enabled: true
http.cors.allow-origin: "*"

修改jvm.options

//本地虚拟机内存设置小一点,生产环境可以根据情况设置大一点
-Xms128m
-Xmx128m

创建esuser启动用户

//创建esuser用户,将文件夹授权给esuser
useradd esuser
chown -R esuser:esuser /usr/local/elasticsearch-7.8.0

修改 /etc/security/limits.conf、/etc/sysctl.conf

vim /etc/security/limits.conf
//在最后一行上方添加如下内容
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

vim /etc/sysctl.conf
//在最下方添加如下内容
vm.max_map_count=262145

//保存成功后,刷新配置
sysctl -p

切换用户,启动es

su esuser
cd /usr/local/elasticserach-7.8.0/bin
./elasticserach -d

启动完成后,通过ip:9200访问
记得开启9200端口

firewall-cmd --add-port=9200/tcp --permanent
firewall-cmd --reload

3、下载elasticserach-head

//进入windows本地文件夹,启动git bash,执行如下命令
git clone git://github.com/mobz/elasticserach-head.git
cd elasticserach-head
npm install
npm run start

启动后通过localhost:9100 访问,连接es即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值