一步步搭建分布式--elasticsearch安装配置

  1. 解压:
    tar zxvf elasticsearch-6.3.1.tar.gz
  2. 递归的给linux目录下的所有文件赋予所有权限
    chmod 777 -R elasticsearch-6.3.1
  3. 修改jvm内存参数
    vim /opt/es/elasticsearch-6.3.1/config/jvm.options
    在这里插入图片描述
  4. 赋予权限
chmod 777 /opt/es/elasticsearch-6.3.1/config/elasticsearch.keystore

logs/gc.log

linux使用curl发送http请求,测试

curl http://www.baidu.com

一步步搭建分布式--elasticsearch安装配置_第1张图片
5 . 配置本机地址,方便被外界访问到 vim /opt/es/elasticsearch-6.3.1/config/elasticsearch.yml
一步步搭建分布式--elasticsearch安装配置_第2张图片
在这里插入图片描述
nofile 文件最大数目
noproc 进程最大数目
soft 当前系统生效的设置值
hard 系统中所能设定的最大值

  1. 修改linux配置(配合es启动需求) vim /etc/security/limits.conf (linux的#也是有作用的)
* hard nofile 65536
* soft nofile 131072
* hard nproc 4096
* soft nproc 2048

刷新一下

在这里插入图片描述
7. 配置系统内存 vim /etc/sysctl.conf

vm.max_map_count=655360
fs.file-max=655360 

sysctl -p (配置生效)

  1. 总结
    elasticSearch.yml es的启动host地址
    jvm.options配置es的虚拟机内存
    limits.conf配置linux的线程内存和文件
    sysctl.conf配置系统允许的软件运行内存

启动运行es

nohup 控制台将(忽略的)日志信息输出到nohup.out

mysql是tcp协议
es是http协议

一步步搭建分布式--elasticsearch安装配置_第3张图片
一个index相当于库,type–是表,document—行数据,field相当于字段
node是es(elasearch)的实例,

安装kibana

一步步搭建分布式--elasticsearch安装配置_第4张图片

  • 启动 nohup ./kibana &
    然后ctrl+c退出
    执行 ps -ef |grep node
    在这里插入图片描述
    http://192.168.3.200:5601/app/kibana#/home?_g=()
    一步步搭建分布式--elasticsearch安装配置_第5张图片
GET _cat/indices
#增
put lmj
##既可以增,又可以覆盖
PUT /movie_index/movie/1
{ "id":1,
  "name":"红海拯救",
  "doubanScore":8.5,
  "actorList":[  
{"id":1,"name":"zhang yi"},
{"id":2,"name":"hai qing"},
{"id":3,"name":"zhang han yu"}
]
}
PUT /movie_index/movie/2
{
  "id":2,
  "name":"湄公河",
  "doubanScore":8.0,
  "actorList":[  
{"id":3,"name":"zhang han yu"}
]
}

PUT /movie_index/movie/3
{
  "id":3,
  "name":"红海事件",
  "doubanScore":5.0,
  "actorList":[  
{"id":4,"name":"zhang chen"}
]
}
# 查
GET movie_index/movie/_search
{
  "query":{
    "match":{"name":"red"}
  }
}

安装IK中文分词器

GET _analyze
{
“analyzer”: “ik_smart”,
“text”: [“我是中国人”]
}

红海

你可能感兴趣的:(分布式)