iOS Mail settings with the Accounts option highlighted
iOS Mail settings with the Accounts option highlighted
iOS Mail Accounts screen with Add Account option highlighted
iOS Mail Accounts screen with Add Account option highlighted
iOS Add Account screen with Other option for manual email setup
iOS Add Account screen with Other option for manual email setup

在 VPS 上开始使用 Elasticsearch。

Elasticsearch 是一个强大的搜索和分析引擎,可实现快速的数据查询和高效的索引。我们的 Elasticsearch VPS 模板让在 Hostinger VPS 上设置 Elasticsearch 变得简单。本指南将引导你完成入门步骤。

如果你还没有 VPS,可在此处查看可用选项:VPS 托管

要开始使用 Elasticsearch,请安装 Ubuntu 22.04 with Elasticsearch 模板并遵循以下步骤:

步骤 1 – 连接到你的 VPS

在本地计算机上打开 Terminal(终端)(Linux/macOS)或 Command Prompt/PowerShell(Windows),并输入以下命令:

ssh root@your_vps_ip

your_vps_ip 替换为你的 VPS IP 地址。系统可能会提示你输入 VPS 密码。

步骤 2 – 验证 Elasticsearch 安装

iOS new account setup screen with Name, Email, Password, and Description fields, plus Next button
iOS new account setup screen with Name, Email, Password, and Description fields, plus Next button
iOS Mail manual setup with IMAP selected for Hostinger email account
iOS Mail manual setup with IMAP selected for Hostinger email account
IMAP settings screen with Mail toggle turned on and Notes toggle off, Save button visible
IMAP settings screen with Mail toggle turned on and Notes toggle off, Save button visible

登录 VPS 后,使用以下命令检查 Elasticsearch 是否正在运行:

systemctl status elasticsearch

你应该看到一条指示 Elasticsearch 处于活动状态且正在运行的消息。通过在终端中发出简单的 HTTP 请求来测试 Elasticsearch API:

curl -X GET "http://localhost:9200"

或者直接访问 http://your_vps_ip:9200/

这两种方法都应返回包含 Elasticsearch 状态的 JSON 响应。

步骤 3 – 使用示例数据测试 Elasticsearch

索引一些示例数据:

curl -X POST "http://localhost:9200/my_index/_doc/1" -H 'Content-Type: application/json' -d'
{
  "name": "Test Data",
  "type": "Sample",
}'

然后查询数据:

curl -X GET "http://localhost:9200/my_index/_search?q=type:Sample"

你应该能够看到刚才在示例中提供的相同数据。

步骤 4 – 可视化与扩展

使用 Kibana 等工具可视化 Elasticsearch 数据。如果你的工作负载增加,可以考虑从 Hostinger hPanel 扩展你的 VPS 资源。

就是这样!现在你可以轻松在 Hostinger VPS 上设置并开始使用 Elasticsearch。享受快速搜索和高效数据管理的强大功能!

请务必探索官方 Elasticsearch 文档 和资源以了解更多 💡

来源:Hostinger 官方帮助文档