book
  • 关于
  • golang
    • 代码片段
  • LANMP
    • 安装
    • Linux
      • 源码编译
      • Linux基本操作命令
      • Linux网络相关命令
      • Crontab 计划任务
    • Nginx
      • 安装
      • 负载均衡
      • 负载均衡分配方式
      • 高可用
    • MySQL
      • 安装
      • 高可用
    • PHP
      • PHP内核
      • 代码段
      • Laravel
    • Swoole
      • easyswoole
        • 安装
    • 设计模式
  • 操作系统和网络
    • 计算机网络
      • IP协议
      • TCP协议
      • UDP协议
      • HTTP协议
      • HTTPS协议
      • HTTP2协议
      • HTTP1 HTTP2的区别
      • Websocket
      • 域名解析
      • Http压测工具 wrk
  • 工具
    • 版本控制
      • git
    • gitbook
      • 配置和插件
      • 插件
      • gitlab + gitbook
    • jenkins
      • 安装
      • 自动部署
    • Elasticsearch
    • go-mysql-elasticsearch
  • Python
    • Python基础
      • list 和 tuple
      • dict 和 set
    • Python爬虫
      • 爬取elasticsearch英文文档
    • 第三方包
      • Scoop
  • 运维
    • 运维
      • Logrotate
      • 服务器记录操作日志
    • 安全
    • Shell
    • VMWare
  • Java
    • Java基础
  • 前端
    • npmjs
由 GitBook 提供支持
在本页
  • 安装
  • 安装IK 分词插件
  • 修改配置文件
  • 句柄数和MMap
  • 启动
  1. 工具

Elasticsearch

安装

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.rpm

rpm -ivh elasticsearch-5.0.0.rpm

安装IK 分词插件

elasticsearch 的版本大于5.5.0

/usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.0.0/elasticsearch-analysis-ik-5.0.0.zip

修改配置文件

vim /etc/elasticsearch/elasticsearch.yml

#cluster.name: my-application 
#node.name: node-1
#network.host: 192.168.0.1
#http.port: 9200

只要简单设置以上四项,不是集群的话只要修改 network.host 就可以,其余可以使用默认值

句柄数和MMap

设置最大句柄数为655360(我们的服务器是默认的),sudo sysctl -a | grep fs.file-max 得到,可以通过 GET /_nodes/process 验证

mmap: sysctl -w vm.max_map_count=262144

或者通过修改 /etc/sysctl.conf 文件中的 vm.max_map_count 永久改变(sudo sysctl -p /etc/sysctl.conf生效)。

启动

systemctl start elasticsearch

上一页自动部署下一页go-mysql-elasticsearch

最后更新于2年前