https://www.elastic.co/cn/downloads/
在linux安装es真的是好麻烦,
1.首选5以后系列是不允许在root下运行,所以我们先创建用户
创建用户组 estest 创建用户esuser -g 用户组 -p 密码
groupadd estest
useradd esuser -g estest -p 111111
2.为用户授权文件使用权
chown 用户 /usr/local/es地址 -R
su 用户 切换用户
启动文件
[root@localhost bin]# chown esuser /usr/local/elasticsearch -R
[root@localhost bin]# su esuser
[esuser@localhost bin]$ ./elasticsearch
3.测试
输入curl 127.0.0.1:9200测试
[root@localhost ~]# curl 127.0.0.1:9200
{
"name" : "lQJbRhG",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "CdAMcEUjTdi_1KFEE6Pjjw",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
4.修改yml配置文件
进入 cd /usr/local/es/config
vim elasticsearch.yml
先不要启动 启动后会报内存,最大数什么的错误我们继续修改
cd /etc/security/
vim limits.conf
* soft nofile 65536
* hard nofile 65536
esuser soft nproc 4096
esuser hard nproc 4096
cd limits.d
vim 20-nproc.conf
[root@localhost etc]# vi ./sysctl.conf
配置生效
[root@localhost etc]# sysctl -p
重启虚拟机
启动es
开通端口号
iptables -I INPUT -ptcp --dport 9200 -j ACCEPT
7.5.2版本添加
network.host: 192.168.43.119
cluster.name: elasticsearch
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
cluster.initial_master_nodes: ["node-1"]
#节点名称和集群数组要对应
node.name: "node-1"
http.port: 9200
访问成功
6.安装kibana
解压后修改conf下的yml文件
修改2处位置
添加
i18n.locale: “zh-CN”
开启端口
iptables -I INPUT -ptcp --dport 5601-j ACCEPT
bin目录下启动kibana
点击dev tools 有个蓝色get按钮 进入这个状态
安装IK分词器 在es的plugins下新建ik目录并解压文件后重启es
Mapping 中设置相当于表结构的定义
可视化工具 ElasticHD
https://github.com/360EntSecGroup-Skylar/ElasticHD/releases
双击???错了 请解压到盘符 后cmd
C:\Users\crazy>f:
F:\>ElasticHD.exe -p 127.0.0.1:9800