最近自己找了三台测试服务器学着装了es。记录一下安装过程。
ElasticSearch
一、下载安装
(1) 下载
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-x86_64.rpm
(2)
sudo rpm --install elasticsearch-7.6.2-x86_64.rpm
默认路径/etc/elasticsearch/
二、配置
3、可能出现的问题
(1)max number of threads [1024] for user [elasticsearch] is too low, increase to at least [4096]
vim /etc/security/limits.d/90-nproc.conf
(2)max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
vim /etc/sysctl.conf
添加vm.max_map_count=262144
(3)【CENTOS6才会】system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
在es.yml中添加
bootstrap.system_call_filter: false
(4)ERROR: bootstrap checks failed memory locking requested for elasticsearch process but memory is not locked
vim /etc/security/limits.conf
添加
* soft memlock unlimited
* hard memlock unlimited
4、配置文件修改
cluster.name: test-cluster
node.name: [HOSTNAME]
path.data: /cache1/elasticsearch/data
path.logs: /cache1/elasticsearch/logs
network.host: 0.0.0.0
node.master: true
node.data: true
http.port: [PORT]
bootstrap.memory_lock: true
第一台启动的机器配置
cluster.initial_master_nodes: ["HOSTNAME"]
其他加入的机器配置
discovery.seed_hosts: ["[MASTER-ELIGIBLE IP]"]
5、修改jvm配置
修改jvm.options
(1)修改-Xms
与Xmx
(2)修改gc文件配置(默认是在es路径的logs下)
6、关闭swap
edit the /etc/fstab
file and comment out any lines that contain the word swap
.
7、修改文件句柄数
Kinana
一、centos version
如果是centos6,会有一个glibc版本过低的异常
建议使用rpm方式安装。本次也是使用rpm方式安装。
二、安装
1、下载
wget https://artifacts.elastic.co/downloads/kibana/kibana-7.6.2-x86_64.rpm
2、安装
sudo rpm --install kibana-7.6.2-x86_64.rpm
3、default path
- 默认配置文件地址:/etc/kibana
- 默认日志地址:/var/log/kibana
4、配置修改
修改配置文件kibana.yml
server.port: 5601 // kibana端口
server.host: 0.0.0.0 // 对外暴露
elasticsearch.hosts: ["http://localhost:port"] // es的地址
5、command
service kibana start/stop/status