如何在Ubuntu 20.04上安装和配置Elasticsearch

本文详述了如何在Ubuntu 20.04服务器上安装和配置Elasticsearch,包括安装先决条件、导入GPG密钥、添加软件包源、安装Elasticsearch、配置网络访问限制、启动服务和测试连接。此外,还讨论了安全性和使用Elasticsearch的基本操作,如创建、读取、更新和删除数据。
摘要由CSDN通过智能技术生成

介绍 (Introduction)

Elasticsearch is a platform for distributed search and analysis of data in real time. It is a popular choice due to its usability, powerful features, and scalability.

Elasticsearch是一个用于实时分布式搜索和数据分析的平台。 由于它的可用性,强大的功能和可伸缩性,它是一个受欢迎的选择。

This article will guide you through installing Elasticsearch, configuring it for your use case, securing your installation, and beginning to work with your Elasticsearch server.

本文将指导您完成安装Elasticsearch,为您的用例进行配置,保护安装并开始与Elasticsearch服务器一起使用。

先决条件 (Prerequisites)

Before following this tutorial, you will need:

在学习本教程之前,您需要:

For this tutorial, we will work with the minimum amount of CPU and RAM required to run Elasticsearch. Note that the amount of CPU, RAM, and storage that your Elasticsearch server will require depends on the volume of logs that you expect.

在本教程中,我们将使用运行Elasticsearch所需的最少CPU和RAM。 请注意,Elasticsearch服务器所需的CPU,RAM和存储量取决于所需的日志量。

步骤1 —安装和配置Elasticsearch (Step 1 — Installing and Configuring Elasticsearch)

The Elasticsearch components are not available in Ubuntu’s default package repositories. They can, however, be installed with APT after adding Elastic’s package source list.

Elasticsearch组件在Ubuntu的默认软件包存储库中不可用。 但是,可以在添加Elastic的软件包源列表之后将它们与APT一起安装。

All of the packages are signed with the Elasticsearch signing key in order to protect your system from package spoofing. Packages which have been authenticated using the key will be considered trusted by your package manager. In this step, you will import the Elasticsearch public GPG key and add the Elastic package source list in order to install Elasticsearch.

所有软件包都使用Elasticsearch签名密钥签名,以保护您的系统免受软件包欺骗的侵害。 使用密钥进行了身份验证的软件包将被您的软件包管理器视为受信任的软件包。 在此步骤中,您将导入Elasticsearch公共GPG密钥并添加Elastic软件包源列表,以便安装Elasticsearch。

To begin, use cURL, the command line tool for transferring data with URLs, to import the Elasticsearch public GPG key into APT. Note that we are using the arguments -fsSL to silence all progress and possible errors (except for a server failure) and to allow cURL to make a request on a new location if redirected. Pipe the output of the cURL command into the apt-key program, which adds the public GPG key to APT.

首先,使用cURL(用于通过URL传输数据的命令行工具)将Elasticsearch公共GPG密钥导入APT。 请注意,我们正在使用参数-fsSL来使所有进度和可能的错误(服务器故障除外)保持沉默,并允许cURL重定向后在新位置上发出请求。 将cURL命令的输出传递到apt-key程序中,该程序将公共GPG密钥添加到APT。

  • curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

    curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt键添加-

Next, add the Elastic source list to the sources.list.d directory, where APT will search for new sources:

接下来,将Elastic source列表添加到sources.list.d目录,APT将在其中搜索新的源:

  • echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

    回声“ deb https://artifacts.elastic.co/packages/7.x/apt稳定主” | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

Next, update your package lists so APT will read the new Elastic source:

接下来,更新您的软件包列表,以便APT读取新的Elastic源:

  • sudo apt update

    sudo apt更
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值