博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在Ubuntu 18.04上安装Elasticsearch
阅读量:2532 次
发布时间:2019-05-11

本文共 4753 字,大约阅读时间需要 15 分钟。

In this tutorial, we will look at how we can install Elasticsearch on Ubuntu 18.04. Elasticsearch is an open-source distributed full-text search and analytics engine. It supports RESTful operations (GET, POST requests) and allows you to store, search, and analyze big volumes of data in real-time.

在本教程中,我们将研究如何在Ubuntu 18.04上安装Elasticsearch。 Elasticsearch是一个开源的分布式全文本搜索和分析引擎。 它支持RESTful操作(GET,POST请求),并允许您实时存储,搜索和分析大量数据。



步骤1:安装先决条件 (Step 1: Install Prerequisites)

Before installing Elasticsearch, we must first get its dependencies. The major dependency is OpenJDK 8 since this is an open-source Java application.

在安装Elasticsearch之前,我们必须首先获取其依赖项。 主要依赖项是OpenJDK 8,因为这是一个开源Java应用程序。

Let’s first update our system and install required packages so that apt can download over https.

首先让我们更新系统并安装所需的软件包,以便apt可以通过https下载。

sudo apt updatesudo apt install apt-transport-https

Now, install OpenJDK 8 (Recommended) using the package manager.

现在,使用包管理器安装OpenJDK 8 (推荐)。

sudo apt install openjdk-8-jdk

Otherwise, if you want to install the most recent version, you can .

否则,如果要安装最新版本,则可以 。

步骤2:下载Elasticsearch套件 (Step 2: Download the Elasticsearch package )

Now that we have our major dependencies installed, we must now download the latest version of Elasticsearch, found at the .

现在我们已经安装了主要的依赖项,我们现在必须下载最新版本的Elasticsearch,该版本位于 。

The latest version is 7.5.1 at the time of writing.

撰写本文时,最新版本为7.5.1

Let’s download the Debian package (.deb) for our system.

让我们为系统下载Debian软件包( .deb )。

Let’s use wget to fetch it from the remote server.

让我们使用wget从远程服务器获取它。

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-amd64.deb

步骤3:安装Elasticsearch (Step 3: Install Elasticsearch)

We will install the Debian package using dpkg package installer for Elasticsearch 7.5.1.

我们将使用Elasticsearch 7.5.1的 dpkg软件包安装程序来安装Debian软件包。

dpkg -i elasticsearch-7.5.1-amd64.deb
Ubuntu Elasticsearch Install
Ubuntu Elasticsearch Install
Ubuntu Elasticsearch安装

A similar output indicates that your installation was successful!

类似的输出表明安装成功!

Now, let us configure Elasticsearch for it to work properly.

现在,让我们配置Elasticsearch使其正常工作。



步骤4:配置Elasticsearch (Step 4: Configure Elasticsearch)

In our first step of configuration, we shall set the IP address of our Server.

在第一步配置中,我们将设置服务器的IP地址。

The Elasticsearch configuration file is available at /etc/elasticsearch/elasticsearch.yml.

Elasticsearch配置文件位于/etc/elasticsearch/elasticsearch.yml

Open your favorite text editor and edit this file.

打开您喜欢的文本编辑器并编辑此文件。

sudo vi /etc/elasticsearch/elasticsearch.yml

Go to the Network Module.

转到网络模块。

Ubuntu Elasticsearch Config File Default
Ubuntu Elasticsearch Config File Default
Ubuntu Elasticsearch配置文件默认

By default, the Network host address is not set. Set it by uncommenting the corresponding line and setting it to the desired IP Address.

默认情况下,未设置网络主机地址。 通过取消注释相应的行并将其设置为所需的IP地址来进行设置。

After editing, your file will look like this:

编辑后,您的文件将如下所示:

Ubuntu Elasticsearch Config File Updated
Ubuntu Elasticsearch Config File Updated
Ubuntu Elasticsearch配置文件已更新

Save changes and exit the editor.

保存更改并退出编辑器。

Now, we have finished our bare-bones setup of Elasticsearch. We now just need to start our server!

现在,我们已经完成了Elasticsearch的基本设置。 现在,我们只需要启动服务器!



步骤5:启用Elasticsearch服务 (Step 5: Enable the Elasticsearch service)

Start and enable the Elasticsearch service using systemctl:

使用systemctl启动并启用Elasticsearch服务:

sudo systemctl enable elasticsearch.servicesudo systemctl start elasticsearch.service

Now that we have started our server, we can now send requests to the Server to verify that it is working properly.

现在我们已经启动了服务器,我们现在可以向服务器发送请求以验证其是否正常运行。

步骤6:测试服务器 (Step 6: Test the server)

You can verify that Elasticsearch is running by sending an HTTP request to port 9200 to your Server address (Mine is 192.168.0.1)

您可以通过将端口9200的HTTP请求发送到您的服务器地址来验证Elasticsearch是否正在运行(我的是192.168.0.1)

curl -X GET "192.168.0.1:9200/"

We will get an output response from the Server. It will look similar to this:

我们将从服务器获得输出响应。 它看起来类似于:

{  "name" : "BEwpV2R",  "cluster_name" : "elasticsearch",  "cluster_uuid" : "T-3S34LRQFqDeIGwQgD1xw",  "version" : {    "number" : "7.5.1",    "build_flavor" : "default",    "build_type" : "deb",    "build_hash" : "d7d56a7",    "build_date" : "2020-01-03T22:55:32.697037Z",    "build_snapshot" : false,    "lucene_version" : "8.0.0",    "minimum_wire_compatibility_version" : "7.3.0",    "minimum_index_compatibility_version" : "7.3.0-beta1"  },  "tagline" : "You Know, for Search"}

Now that our server is working properly, we have successfully configured our Elasticsearch service, and we are now ready to use it!

现在我们的服务器可以正常工作,我们已经成功配置了Elasticsearch服务,现在可以使用它了!



结论 (Conclusion)

In this tutorial, we learned how we could setup and install Elasticsearch on our Ubuntu 18.04 machine in just a few simple steps.

在本教程中,我们学习了如何仅需几个简单步骤就可以在Ubuntu 18.04计算机上设置和安装Elasticsearch。



翻译自:

转载地址:http://eumzd.baihongyu.com/

你可能感兴趣的文章
小D课堂 - 新版本微服务springcloud+Docker教程_5-08 断路器监控仪表参数
查看>>
小D课堂 - 新版本微服务springcloud+Docker教程_6-02 springcloud网关组件zuul
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-1.快速搭建SpringBoot项目,采用Eclipse...
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_1-4.在线教育后台数据库设计...
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-3.热部署在Eclipse和IDE里面的使用...
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_1-3.在线教育站点需求分析和架构设计...
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-4.后端项目分层分包及资源文件处理...
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-2.快速搭建SpringBoot项目,采用IDEA...
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_3-5.PageHelper分页插件使用
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_5-6.微信扫码登录回调本地域名映射工具Ngrock...
查看>>
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_5-8.用户模块开发之保存微信用户信息...
查看>>
Linux下Nginx安装
查看>>
LVM扩容之xfs文件系统
查看>>
Hbase记录-client访问zookeeper大量断开以及参数调优分析(转载)
查看>>
代码片段收集
查看>>
vue-cli3创建项目时报错
查看>>
输入1-53周,输出1-53周的开始时间和结束时间
查看>>
实验二
查看>>
shell——按指定列排序
查看>>
crash 收集
查看>>