0
点赞
收藏
分享

微信扫一扫

elsearch5.5 + x-pack,elasticsearch5.5安装 单机版

 elasticsearch5.5安装 单机版

 官方文档:https://www.elastic.co/guide/en/elasticsearch/reference/5.5/index.html

 一、Elastic基本功能

Elasticsearch 是一个实时分布式搜索和分析引擎,一般用于全文搜索、结构化搜索,分析或者三者混用。

它的底层是基于Apache Lucene(TM)的开源搜索引擎,但是lucene只是一个库,需要java开发然后集成到应用。

Elasticsearch的特性描述:

分布式实时文件存储,每个字段都能被索引并且可以被搜索

分布式的实时分析搜索引擎

可以扩展到上百台服务器,处理PB级结构化或者非结构化数据

 二、 Elastic 安装准备

 centos7.9

 jdk8

 elasticsearch5.5

 1. java环境需要安装 jdk8,对应下载 tar包

  官网链接:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html


内部公司已存放 softpkgxxx/softwar/java/


##### java安装:自行安装 可以参考。

tar zxvf jdk-8u152-linux-x64.tar.gz

#解压完成后,配置JAVA_HOME的环境变量

[root@master ~]# vim /etc/profile

#我一般是习惯放在文件最后

#===============JAVA_HOME======================

#这些环境变量配置的就是刚刚tar包解压之后的目录下

export JAVA_HOME=/usr/local/jdk1.8.0_152

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$PATH:$JAVA_HOME/bin

"/etc/profile" 83L, 1972C written

[root@master ~]# source /etc/profile

#查看一下版本是否正确

[root@master ~]# java -version

java version "1.8.0_152"

Java(TM) SE Runtime Environment (build 1.8.0_152-b16)

Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

=================================================

到目前为止,jdk8安装完毕


####

2.安装elastic 下载解压即可

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip

--2018-03-27 11:29:36-- https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip

Resolving artifacts.elastic.co (artifacts.elastic.co)... 184.73.245.233, 184.73.156.41, 54.235.82.130, ...

Connecting to artifacts.elastic.co (artifacts.elastic.co)|184.73.245.233|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 33511694 (32M) [application/zip]

Saving to: ‘elasticsearch-5.5.1.zip’


mv elasticsearch-5.5.1.zip  /usr/local/

unzip  elasticsearch-5.5.1.zip

cd /usr/local/elasticsearch-5.5.1


3.注 请核对系统参数

 

#### 注提前准备 开始

3.1错误:RROR: [2] bootstrap checks failed

[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]


解决方法如下:

对于问题[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

修改/etc/security/limits.conf文件,添加或修改如下行:

vim /etc/security/limits.conf

*        hard    nofile           65536

*        soft    nofile           65536

3.2对于问题[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

修改 /etc/sysctl.conf 文件,添加 “vm.max_map_count”设置

vim /etc/sysctl.conf


vm.max_map_count = 262144

设置后使用如下命令使其生效:

sysctl -p


3.3 报错 rootxxx权限问题,默认 不能使用root启动;我这边 创建elastic用户

useradd elastic

passwd elastic


chown elastic.elastic /usr/local/elasticsearch-5.5.1 -R


3.4 允许远程访问,添加一下一列

cat config/elasticsearch.yml  |grep -v ^#

network.host: 0.0.0.0


#xpack.security.enabled: true        #### 为后续 开启账号认证使用的。


#### 注

安装成功后默认为开启权限验证模块,默认会创建三个用户:elastic,kibana,logstash_system,默认密码均问changeme

####



######  注 提前准备 结束


4.运行 elastic

su - elastic

cd /usr/local/elasticsearch-5.5.1

./elasticsearch      

####查看是否有错误, 若无 退出后  重新执行 后台运行。

./elasticsearch   -d


## 本次测试:

curl 'http://localhost:9200/?pretty'     ####查看是否有数据显示

 curl -i -XGET 'localhost:9200/_count?pretty'

​​ https://www.cnblogs.com/Kid-Zhou/p/9088772.html​​

三、elasticsearch5.5  安装 X-Pack

1.关闭ElasticSearch服务

需要关闭Elasticsearch 服务,如果已经启动的话,则安装安装x-pack失败。

2、ElasticSearch5.x安装x-pack

安装过程中遇到选项直接Y过去就可以了

# bin/elasticsearch-plugin install x-pack

++++++++++++++

for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@        WARNING: plugin forks a native controller        @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

This plugin launches a native controller that is not subject to the Java

security manager nor to system call filters.

Continue with installation? [y/N]y

-> Installed x-pack

++++++++++++++


四、安装 kibana

 wget https://artifacts.elastic.co/downloads/kibana/kibana-5.5.0-linux-x86_64.tar.gz

tar -zvxf kibana-5.5.0-linux-x86_64.tar.gz

cd kibana-5.5.0-linux-x86_64

vim kibana-5.5.0-linux-x86_64/config/kibana.yml


修改配置文件:

server.host: "0.0.0.0"

elasticsearch.url: "http://localhost:9200"

elasticsearch.username: "kibana"

elasticsearch.password: "changeme"



在线安装X-Pack for Kibana:

cd kibana-5.5.0-linux-x86_64/bin

./kibana-plugin install x-pack

+++++++++++++++++++++++++++++++++++++++++

Attempting to transfer from x-pack

Attempting to transfer from https://artifacts.elastic.co/downloads/kibana-plugins/x-pack/x-pack-5.5.0.zip

Transferring 119276235 bytes....................

Transfer complete

Retrieving metadata from plugin archive

Extracting plugin archive

Extraction complete

Optimizing and caching browser bundles...

Plugin installation complete

++++++++++++++++++++++++++++++++++++++

启动 kibana

cd kibana-5.5.0-linux-x86_64/

nohup bin/kibana &

++++++++++++

 nohup: 忽略输入并把输出追加到"nohup.out"

++++++++

然后在浏览器中访问http://xxxxxxip:5601即可查看Kibana界面




默认用户名和密码如下:

用户名:elastic

密码:changeme

####

修改密码:

在devtools 工具里,  如修改kibana 密码为  kibana

####

PUT _xpack/security/user/kibana/_password

{

   "password": "kibana"

}

####

其他参考相关

集群搭建

​​ https://www.jianshu.com/p/53f41f4cbf70?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation​​

elasticserach辅助工具:安装elasticsearch-head插件

​​ https://www.cnblogs.com/Kid-Zhou/p/9088772.html​​

####

参考url:

​​https://cloud.tencent.com/developer/article/1994038​​

​​https://www.jianshu.com/p/53f41f4cbf70?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation​​

举报

相关推荐

0 条评论