1. 下载好elastic2.2.0,修改elasticsearch.yml,报这个错误:


wKiom1cEfOLByPYdAAAZDgXhwlI305.png


wKiom1cEfKmz1a_9AABczwbZGp4284.png


问题出在空格上,需要有空格。就OK了。



2.elasticsearch不能用root启动,需要添加普通用户

[root@node160bin]# groupadd elk
[root@node160bin]# useradd elk -g elk -p elasticsearch
[root@node162elk]# chown  -R elk.elk  elasticsearch-2.1.1
[root@node160elk]# passwd  elk
更改用户 elk 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@node160elk]#



3.如果不是yum安装的elasticsearch,安装服务

到这里把软件下载:
[root@es src]# pwd
/usr/local/src
[root@es src]# unzip elasticsearch-servicewrapper-master.zip  //解压软件
[root@es src]# ll
total 153708
-rw-r--r--. 1 root root  28478292 Dec 29 10:47 elasticsearch-1.7.2.tar.gz
drwxr-xr-x. 3 root root      4096 Feb 14 03:02 elasticsearch-servicewrapper-master
-rw-r--r--. 1 root root   2054227 Mar 17 14:10 elasticsearch-servicewrapper-master.zip
-rw-r--r--. 1 root root 126857158 Dec 21 17:09 jdk-7u67-linux-x64.rpm
[root@es src]# mv elasticsearch-servicewrapper-master/service/ /usr/local/elasticsearch-1.7.2/bin/     
[root@es src]# 
//将service目录移动到 elasticsearch下面的bin目录下面去
 
 
 
 
[root@es service]# pwd
/usr/local/elasticsearch-1.7.2/bin/service
[root@es service]# ./elasticsearch
Usage: ./elasticsearch [ console | start | stop.... ]
 
Commands:
  console      Launch in the current console.
  start        Start in the background as a daemon process.
  stop         Stop if running as a daemon or in another console.
  restart      Stop if running and then start.
  condrestart  Restart only if already running.
  status       Query the current status.
  install      Install to start automatically when system boots.
  remove       Uninstall.
  dump         Request a Java thread dump if running.
  
  开始安装服务:

wKiom1cEgYqBmwF9AAAx9bp0F1g115.png



4.kibana报错

wKioL1cEkQyjUDQFAABrMOySoE8271.png


问题出在:有一个node程序在运行,kill他,启动就可以了。


You have a case where Kibana is killed but node.js process is running. Search for process listening on 5601 port
netstat -apln | grep 5601
Kill this process ( kill -9 )
Try to start kibana, you will succeed.




5.ELK兼容性问题

logstatsh 2.2.0 , elasticsearch 2.2.0 ,kibana 4.4.0适合!





elasticsearch2.2.0安装流程


  1. 将elastic安装包解压到/usr/local/

  2. 将elastic解压包用户全部调整成elk用户

  3. 安装head插件:

./plugin install mobz/elasticsearch-head

head访问方式:http://youip:9200/_plugin/head/


4.修改elasticsearch.yml

network.host= 192.168.1.108

注意空格

http.port= 9200


5.修改kibana.yml

elasticsearch_url: "http://192.168.1.108:9200"