Ubuntu 18.4安装elasticsearch 8.3.2 + kibana 8.3.2

2023-05-16

集群规划

主机名IP地址角色
els-master10.20.2.200ELS-MASTER
kibana10.20.2.203KIBANA

els安装

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.3.2-linux-x86_64.tar.gz
tar xf elasticsearch-8.3.2-linux-x86_64.tar.gz
mv elasticsearch-8.3.2 /usr/local/
vim /usr/local/elasticsearch-8.3.2/config/elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: ES-Cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: els-master
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /usr/local/elasticsearch-8.3.2/data
#
# Path to log files:
#
path.logs: /usr/local/elasticsearch-8.3.2/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
network.host: 0.0.0.0
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["10.20.2.200", "10.20.2.201","10.20.2.202"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["10.20.2.200"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# --------------------------------- Readiness ----------------------------------
#
# Enable an unauthenticated TCP readiness endpoint on localhost
#
#readiness.port: 9399
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /usr/local/elasticsearch-8.3.2/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /usr/local/elasticsearch-8.3.2/config/elastic-certificates.p12

# 配置环境
echo vm.max_map_count=655360 >> /etc/sysctl.conf
sysctl -p

# 生成证书
/usr/local/elasticsearch-8.3.2/bin/elasticsearch-certutil ca
/usr/local/elasticsearch-8.3.2/bin/elasticsearch-certutil cert --ca /usr/local/elasticsearch-8.3.2/elastic-stack-ca.p12
mv /usr/local/elasticsearch-8.3.2/elastic-* /usr/local/elasticsearch-8.3.2/config/
/usr/local/elasticsearch-8.3.2/bin/elasticsearch-keystore create

# 目录授权
useradd -r -s /bin/bash elastic
chown elastic. -R /usr/local/elasticsearch-8.3.2/

# 启动elastic
su - elastic
/usr/local/elasticsearch-8.3.2/bin/elasticsearch -d

# 设置密码,可不重启elastic
/usr/local/elasticsearch-8.3.2/bin/elasticsearch-setup-passwords interactive

Enter password for [elastic]:

Enter password for [apm_system]:

Enter password for [kibana_system]:

Enter password for [logstash_system]:

Enter password for [beats_system]:

Enter password for [remote_monitoring_user]:

kibana

wget https://artifacts.elastic.co/downloads/kibana/kibana-8.3.2-linux-x86_64.tar.gz
tar xf kibana-8.3.2-linux-x86_64.tar.gz
mv kibana-8.3.2 /usr/local/
vim /usr/local/kibana-8.3.2/config/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
server.publicBaseUrl: "http://10.20.2.203:5601"
elasticsearch.hosts: ["http://10.20.2.200:9200"]
elasticsearch.username: "kibana_system"
elasticsearch.password: "kibana_system"

useradd -r -s /bin/bash kibana
chown kibana. -R /usr/local/kibana-8.3.2/

su - kibana
cd /usr/local/kibana-8.3.2/
nohup bin/kibana &
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Ubuntu 18.4安装elasticsearch 8.3.2 + kibana 8.3.2 的相关文章

随机推荐