Elasticsearch + Kibana 7.16.2 环境搭建(单机)

下载链接:

Elasticsearch 7.16.2 | Elastic

Kibana 7.16.2 | Elastic

官网文档:

Elasticsearch Guide [7.16] | Elastic

 Kibana Guide [7.16] | Elastic

1 JDK设置

JDK1.8下载链接:Java Archive Downloads - Java SE 8u211 and later

vi ~/.bashrc
===========================================
JAVA_HOME=/opt/jdk
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH

2 OS设置

OS: centos 8

echo "vm.max_map_count=655300" >>/etc/sysctl.conf
sysctl -p
vi /etc/security/limits.conf
=================================
* soft nofile  1024000
* hard nofile  1024000
* soft nproc   unlimited
* hard nproc   unlimited
* soft memlock unlimited
* hard memlock unlimited
* soft core    unlimited
* hard core    unlimited
* soft stack   unlimited
* hard stack   unlimited

3 配置文件

vi $ES_PATH_CONF/elasticsearch.yml
============================================
cluster.name: my-es
node.name: node-1
bootstrap.memory_lock: true
network.host: 192.168.1.11
http.port: 9200
discovery.type: single-node
ingest.geoip.downloader.enabled: false
vi jvm.options
=================================================
-Xms4g
-Xmx4g

4 启动ES

$ES_PATH_CONF/bin/elasticsearch -d

验证:http://192.168.1.11:9200/

5 安全设置

先停止elasticsearch与kibana

vi $ES_PATH_CONF/elasticsearch.yml
===新增==============================
xpack.security.enabled: true
# 启动ES
bin/elasticsearch -d
# 设置密码
bin/elasticsearch-setup-passwords interactive

Please confirm that you would like to continue [y/N]y
Enter password for [elastic]: 
Reenter password for [elastic]: 
Enter password for [apm_system]: 
Reenter password for [apm_system]: 
Enter password for [kibana_system]: 
Reenter password for [kibana_system]: 
Enter password for [logstash_system]: 
Reenter password for [logstash_system]: 
Enter password for [beats_system]: 
Reenter password for [beats_system]: 
Enter password for [remote_monitoring_user]: 
Reenter password for [remote_monitoring_user]: 
Changed password for user [apm_system]
Changed password for user [kibana_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]

# 验证
curl -i http://xxxxxx:9200 --user admin:admin

6 kibana设置

# 配置JDK环境变量
export JAVA_HOME=/app/jdk
export PATH=$PATH:$JAVA_HOME/bin
vi $KIB_PATH_CONF/kibana.yml
====================================================
server.port: 5601
server.host: "192.168.1.11"
elasticsearch.hosts: ["http://192.168.1.11:9200"]
elasticsearch.username: "kibana_system"
# 创建Kibana keystore
bin/kibana-keystore create
# 添加密码
bin/kibana-keystore add elasticsearch.password
# 启动kibana
nohup bin/kibana &

验证:http://192.168.1.11:5601/

你可能感兴趣的:(Elastic,elasticsearch,大数据,搜索引擎)