A cloud environment, how to quickly build ES cluster to achieve normal access Kibana Web UI's?

 Elasticsearch referred to collectively herein "ES". In many cases, because of work or study need to use ES cluster, but its own server and limited resources, how to solve this problem? Here with a cloud server station, implemented ES cluster structures and achieve normal connection Kibana.

Step one: Check the system environment, software environment

OS: CentOS 7.6

ES: ES 6.8.x

JDK: 1.8.181

Step 2: Install ES cluster

The ES software download from the official website and extract to / usr / local / directory, configuration JDK development environment variables (omitted here)

Step 3: Install details

By default, our ES in the case without any configuration changes, can be normal start. Because the ES has two modes, one is the development model, the model is intended for developers, operation and maintenance personnel to verify that it is functioning properly complete. By default, that is development. Mode. Once the changes to the configuration file, then it runs in another mode Production mode of production. So here we do not change the configuration. Because after ES6, we need to create a normal user to start properly ES services. So we need to create a normal user, and ES installation directory licensed to just the new user. Command is as follows:

So, we su - elas switch to the next user, start ES Service

/usr/local/elasticsearch-6.8.2/bin/elasticsearch 

View by JPS success

Well, then, the focus here, we start the second ES node, the command is as follows:

bin/elasticsearch -Ehttp.port=8200 -Epath.data=node2

 

This means above command is: change the port, change the index is stored in the directory name, the default is to install the data directory in the directory. To see whether the start ok?

Then start a node, the same command

bin/elasticsearch -Ehttp.port=7200 -Epath.data=node3

View by JPS command: three ES process started.

Take a look at the storage location of the index directory under the installation directory

我们知道,一个服务器上安装三个节点没问题了,但是三个节点是否组成一个集群呢?三者间有没有联系呢?我们确认一下:

通过随便查看一个端口的状态我们可以看到有3个节点,然后带*号的是主节点,也就是Master节点。

我们再查看一下集群节点的状态:发现3个节点,集群的信息都显示出来了。说明集群间的连接是正常的。对吧。

一般情况下,ES作为实时的分布式搜索引擎,我们肯定不能将其暴露在外网,我们信息人员要保证其绝对的安全。但是我们又要操作ES,怎么办呢?这里推荐Kibana。它也是ELK Stack系列产品,能很好的无缝对接ES链接。Kibana基于Nodejs开发,解压即可使用。下面,我们将Kibana与ES进行链接

将Kibana解压到/usr/local下,解压即可。

进入安装目录,看config/kibana.yml文件,作简单的配置

只需要改下面三个地方

server.port ---->kibana对外提供服务的http端口

server.host----->默认是localhost.因为这里是云主机,需要外网可以访问,因此我们需要改成0.0.0.0.但是如果是自己的虚拟机或者物理服务器我们需要改成自己的IP。

elastisearch.hosts----->Kibana链接ES的地址,一般Kibana跟ES都会安装在一起。所以这里只要改成127.0.0.1:9200即可。也就是说链接ES的内网IP即可。

然后启动Kibana即可。 nohup $kibana安装目录/bin/kinaba &   ----->后台启动。

看浏览器能否正常打开界面呢?发现打开正常。说明Kibana链接ES集群成功

 

 

经查,我们可以在Kibana查到集群的三个节点的信息。至此,云主机快速搭建ES集群并连接kibana成功。

实际上,这个主机的ip为私有地址。这就实现了Kibana的外网访问,然后收集ES数据进行展示、存储、分析的过程。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

发布了9 篇原创文章 · 获赞 7 · 访问量 7964

Guess you like

Origin blog.csdn.net/weixin_43236191/article/details/104190280