ElasticSearch安装和使用


https://elasticsearch.cn/download/

 

 

 或者

 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.rpm

 

 

 

 

 

[root@localhost bin]# pwd
/usr/share/elasticsearch/bin
[root@localhost bin]# ll
总用量 20
-rwxr-xr-x 1 root root 1523 11月 11 2017 elasticsearch
-rwxr-xr-x 1 root root 1893 11月 11 2017 elasticsearch-env
-rwxr-xr-x 1 root root  239 11月 11 2017 elasticsearch-keystore
-rwxr-xr-x 1 root root  229 11月 11 2017 elasticsearch-plugin
-rwxr-xr-x 1 root root  242 11月 11 2017 elasticsearch-translog

 

[root@localhost share]# su elasticsearch/
su: user elasticsearch/ does not exist
[root@localhost share]# su elasticsearch
This account is currently not available.
[root@localhost share]# cat /etc/passwd |grep elasticsearch
elasticsearch:x:989:984:elasticsearch user:/home/elasticsearch:/sbin/nologin

 

 

今天在一台新服务器下切换用户的时候出现“This account is currently not available”错误
上网检索了一 下发现是用户的shell禁止登录的问题

解决办法:
比如我是 su elasticsearch的时候出现的问题
用cat看看 apache的帐号信息
# cat /etc/passwd | grep apache
发现它的shell是“/sbin /nologin”,需要改成“/bin/bash”
# vi /etc/passwd
修改完毕后,保存退出

这 样再 su elasticsearch就可以很容易进去了

 

elasticsearch:x:989:984:elasticsearch user:/home/elasticsearch:/bin/bash

 

 

groupadd elasticsearch
useradd -g elasticsearch elasticsearch
chown -R elasticsearch:eelasticsearchla /usr/local/elasticsearch
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/

 

启动错误收集:
    错误一:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
    解决:
修改/etc/security/limits.conf文件

*               soft    nofile          85536
*               soft    nproc           85536
*               hard    nofile          85536
*               hard    nproc           85536
*                -      nofile          85536
elasticsearch   sfot    nofile          100000
elasticsearch   hard    nofile          100000


vim /etc/sysctl.conf

vm.max_map_count=655360
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_tw_reuse = 1
fs.file-max = 65536
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_fin_timeout = 25
net.ipv4.tcp_max_orphans = 8192
net.ipv4.ip_local_port_range = 32768    61000

sysctl -p



vim /etc/security/limits.d/20-nproc.conf

*          soft    nproc     85536
*          hard    nproc     85536
root       soft    nproc     unlimited

vi /etc/ssh/sshd_config

将# UseLogin no

UseLogin yes

重启sshd服务

 

 

切换到  elasticsearch 运行

su elasticsearch
cd /usr/share/elasticsearch/bin/
./elasticsearch -Ehttp.port=8200 -Epath.data=node2

 

 

http://192.168.2.245:7200/_cat/nodes?v

ip            heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.2.245           21          96  10    0.11    0.17     0.13 mdi       -      bIjFGK8
192.168.2.245           17          96  10    0.11    0.17     0.13 mdi       -      c_Slakt
192.168.2.245           24          96   6    0.11    0.17     0.13 mdi       *      y4pYif7

 

 

kibana安装和使用

下载地址:https://elasticsearch.cn/download/

 

 

 tar -zxvf ./kibana-6.0.0-linux-x86_64.tar.gz

 cd kibana-6.0.0-linux-x86_64/

vim kibana.yml

如果要外网可以访问:

server.host: "0.0.0.0"

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM