我们可以到Elastic Search的官网下载Elastic Search:官网.(此处无力吐槽国外的镜像地址是真的真的慢呀~)。传送门传送华为云Elastic Search镜像
下载Elastic Search 7.4.2
上传至Linux服务器
解压缩并移动
# 解压缩
tar -zxvf elasticsearch-7.4.2-linux-x86_64.tar.gz
# 移动
mv elasticsearch-7.4.2 /usr/local/
修改配置文件
修改elasticsearch.yml的配置
cluster.name: my-elasticsearch
node.name: node-1
path.data: /usr/local/elasticsearch-7.4.2/data
path.logs: /usr/local/elasticsearch-7.4.2/logs
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: ["es-node1"]
修改jvm.options
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms128m
-Xmx128m
创建非root用户
# 添加esuser用户
useradd esuser
# 赋予esuser用户权限
chown -R esuser:esuser /usr/local/elasticsearch-7.4.2
启动ElasticSearch
su esuser
./elasticsearch
出现报错<也是常见的坑之一>
解决报错
# 切换到root
su root
#
vi /etc/security/limits.conf 添加如下内容
* soft nofile 65535
* hard nofile 65536
* soft nproc 4048
* hard nproc 4096
vi /etc/sysctl.conf 下方添加如下内容
vm.max_map_count=262145
刷新配置
sysctl -p
启动ElasticSearch
浏览器访问9200端口
ip:9200
ElasticSearch后台启动
# -d daemonize 守护进程
./elasticsearch -d
关闭进程
jps
kill 2329
使用Kibanna进行可视化操作
传送门:华为云Kibana
上传压缩包
解压缩并移动
# 解压缩
tar -zxvf kibana-7.4.2-linux-x86_64.tar.gz
# 移动
mv kibana-7.4.2-linux-x86_64 /usr/local
修改配置文件
server.port:5601
server.host:0.0.0.0
elasticsearch.hosts: ["http://172.16.31.134:9200"]
kibana.index:".kibana"
授权用户
# 同样不能以root用户启动 授权esuser用户操作权限
chown -R esuser:esuser /usr/local/kibana-7.4.2-linux-x86_64/
启动kibana
./kibana
启动浏览器访问Kibana
点击小扳手 即可进入console交互