-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup/install #4
base: cn
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
[[deb]] | ||
=== Install Elasticsearch with Debian Package | ||
=== 使用 Debian 包安装 Elasticsearch | ||
|
||
The Debian package for Elasticsearch can be <<install-deb,downloaded from our website>> | ||
or from our <<deb-repo,APT repository>>. It can be used to install | ||
Elasticsearch on any Debian-based system such as Debian and Ubuntu. | ||
Debian 包可以从 <<install-deb,从官网下载>> 或者 <<deb-repo,APT 仓库>>获取。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debian 包可以从 <<install-deb,官网>> 或者 <<deb-repo,APT 仓库>>下载。 |
||
它适用于 Debian 和 Ubuntu 等所有 Debian-based 系统。 | ||
|
||
The latest stable version of Elasticsearch can be found on the | ||
link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can | ||
be found on the link:/downloads/past-releases[Past Releases page]. | ||
最新的稳定版本可以在 | ||
link:/downloads/elasticsearch[Download Elasticsearch] 找到。 | ||
其他版本可以在 | ||
link:/downloads/past-releases[Past Releases page]找到。 | ||
|
||
NOTE: Elasticsearch requires Java 8 or later. Use the | ||
NOTE: Elasticsearch 最低要求 Java 8。使用 | ||
http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution] | ||
or an open-source distribution such as http://openjdk.java.net[OpenJDK]. | ||
或者开源版本 http://openjdk.java.net[OpenJDK]。 | ||
|
||
[[deb-key]] | ||
==== Import the Elasticsearch PGP Key | ||
==== 引入 Elasticsearch PGP Key | ||
|
||
include::key.asciidoc[] | ||
|
||
|
@@ -24,24 +24,24 @@ wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add | |
------------------------- | ||
|
||
[[deb-repo]] | ||
==== Installing from the APT repository | ||
==== 从 APT 仓库安装 | ||
|
||
ifeval::["{release-state}"=="unreleased"] | ||
|
||
Version {version} of Elasticsearch has not yet been released. | ||
Elasticsearch Version {version} 暂未发布。 | ||
|
||
endif::[] | ||
|
||
ifeval::["{release-state}"!="unreleased"] | ||
|
||
You may need to install the `apt-transport-https` package on Debian before proceeding: | ||
运行之前你需要在 Debian 安装 `apt-transport-https` 包。 | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
sudo apt-get install apt-transport-https | ||
-------------------------------------------------- | ||
|
||
Save the repository definition to +/etc/apt/sources.list.d/elastic-{major-version}.list+: | ||
将仓库定义保存到 +/etc/apt/sources.list.d/elastic-{major-version}.list+: | ||
|
||
ifeval::["{release-state}"=="released"] | ||
|
||
|
@@ -65,23 +65,21 @@ endif::[] | |
[NOTE] | ||
================================================== | ||
|
||
These instructions do not use `add-apt-repository` for several reasons: | ||
不适用 `add-apt-repository` 有以下原因: | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 多了一行空行 😂 |
||
. `add-apt-repository` 将 entries 添加到系统 `/etc/apt/sources.list` 文件, | ||
而不是`/etc/apt/sources.list.d` 中干净的 per-repository 文件。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
. `add-apt-repository` 在很多版本上不是默认安装的并且需要很多非默认依赖。 | ||
. 旧版本的 `add-apt-repository` 经常添加一个 `deb-src` entry,这会造成错误,因为我们不提供源代码包。如果你添加 `deb-src` entry,除非删除 `deb-src` 否则你会看到以下错误: | ||
|
||
. `add-apt-repository` adds entries to the system `/etc/apt/sources.list` file | ||
rather than a clean per-repository file in `/etc/apt/sources.list.d` | ||
. `add-apt-repository` is not part of the default install on many distributions | ||
and requires a number of non-default dependencies. | ||
. Older versions of `add-apt-repository` always add a `deb-src` entry which | ||
will cause errors because we do not provide a source package. If you have added | ||
the `deb-src` entry, you will see an error like the following until you delete | ||
the `deb-src` line: | ||
|
||
Unable to find expected entry 'main/source/Sources' in Release file | ||
(Wrong sources.list entry or malformed file) | ||
|
||
================================================== | ||
|
||
You can install the Elasticsearch Debian package with: | ||
你可以用 Debian 包安装 Elasticsearch: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
|
@@ -90,31 +88,31 @@ sudo apt-get update && sudo apt-get install elasticsearch | |
|
||
[WARNING] | ||
================================================== | ||
If two entries exist for the same Elasticsearch repository, you will see an error like this during `apt-get update`: | ||
如果同一个 Elasticsearch 库中存在两个 entries,则在 `apt-get update` 中会看到类似这样的错误: | ||
|
||
["literal",subs="attributes,callouts"] | ||
|
||
Duplicate sources.list entry https://artifacts.elastic.co/packages/{major-version}/apt/ ...` | ||
|
||
Examine +/etc/apt/sources.list.d/elasticsearch-{major-version}.list+ for the duplicate entry or locate the duplicate entry amongst the files in `/etc/apt/sources.list.d/` and the `/etc/apt/sources.list` file. | ||
检查 +/etc/apt/sources.list.d/elasticsearch-{major-version}.list+ 或者从 `/etc/apt/sources.list.d/` 和 `/etc/apt/sources.list` 文件中定位重复 entry。 | ||
================================================== | ||
|
||
endif::[] | ||
|
||
include::skip-set-kernel-parameters.asciidoc[] | ||
|
||
[[install-deb]] | ||
==== Download and install the Debian package manually | ||
==== 手动下载安装 Debian 包 | ||
|
||
ifeval::["{release-state}"=="unreleased"] | ||
|
||
Version {version} of Elasticsearch has not yet been released. | ||
Elasticsearch Version {version} 暂未发布。 | ||
|
||
endif::[] | ||
|
||
ifeval::["{release-state}"!="unreleased"] | ||
|
||
The Debian package for Elasticsearch v{version} can be downloaded from the website and installed as follows: | ||
Elasticsearch v{version} Debian 包可从官网下载安装: | ||
|
||
["source","sh",subs="attributes"] | ||
-------------------------------------------- | ||
|
@@ -123,34 +121,32 @@ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version | |
shasum -a 512 -c elasticsearch-{version}.deb.sha512 <1> | ||
sudo dpkg -i elasticsearch-{version}.deb | ||
-------------------------------------------- | ||
<1> Compares the SHA of the downloaded Debian package and the published checksum, which should output | ||
`elasticsearch-{version}.deb: OK`. | ||
<1> 比较下载的 Debian 包的 SHA 和 发布校验和,应该输出 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 比较下载的 Debian 包的 SHA 值和发布的校验和,应该输出 |
||
`elasticsearch-{version}.zip: OK`。 | ||
|
||
endif::[] | ||
|
||
include::init-systemd.asciidoc[] | ||
|
||
[[deb-running-init]] | ||
==== Running Elasticsearch with SysV `init` | ||
==== SysV `init` 运行 Elasticsearch | ||
|
||
Use the `update-rc.d` command to configure Elasticsearch to start automatically | ||
when the system boots up: | ||
系统启动时可使用 `update-rc.d` 命令手动配置启动 Elasticsearch: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
sudo update-rc.d elasticsearch defaults 95 10 | ||
-------------------------------------------------- | ||
|
||
Elasticsearch can be started and stopped using the `service` command: | ||
可以用 `service` 命令启动和停止 Elasticsearch: | ||
|
||
[source,sh] | ||
-------------------------------------------- | ||
sudo -i service elasticsearch start | ||
sudo -i service elasticsearch stop | ||
-------------------------------------------- | ||
|
||
If Elasticsearch fails to start for any reason, it will print the reason for | ||
failure to STDOUT. Log files can be found in `/var/log/elasticsearch/`. | ||
如果启动失败,Elasticsearch 会将错误日志打印输出。具体日志可以在 `/var/log/elasticsearch/` 找到。 | ||
|
||
[[deb-running-systemd]] | ||
include::systemd.asciidoc[] | ||
|
@@ -159,69 +155,65 @@ include::systemd.asciidoc[] | |
include::check-running.asciidoc[] | ||
|
||
[[deb-configuring]] | ||
==== Configuring Elasticsearch | ||
==== 配置 Elasticsearch | ||
|
||
include::etc-elasticsearch.asciidoc[] | ||
|
||
The Debian package also has a system configuration file (`/etc/default/elasticsearch`), | ||
which allows you to set the following parameters: | ||
Debian package 同样有一个系统配置文件 (`/etc/default/elasticsearch`),该文件允许你设置如下参数: | ||
|
||
include::sysconfig-file.asciidoc[] | ||
|
||
NOTE: Distributions that use `systemd` require that system resource limits be | ||
configured via `systemd` rather than via the `/etc/sysconfig/elasticsearch` | ||
file. See <<systemd>> for more information. | ||
NOTE: `systemd` 版本要求资源通过 `systemd` 配置而不是 `/etc/sysconfig/elasticsearch` 文件。 | ||
更多详情请参考 <<systemd>>。 | ||
|
||
[[deb-layout]] | ||
==== Directory layout of Debian package | ||
==== Debian 包目录结构 | ||
|
||
The Debian package places config files, logs, and the data directory in the appropriate | ||
locations for a Debian-based system: | ||
Debian 包将配置文件、日志和数据目录放在 Debian 系统合适位置: | ||
|
||
|
||
[cols="<h,<,<m,<m",options="header",] | ||
|======================================================================= | ||
| Type | Description | Default Location | Setting | ||
| home | ||
| Elasticsearch home directory or `$ES_HOME` | ||
| Elasticsearch 根目录或 `$ES_HOME` | ||
| /usr/share/elasticsearch | ||
d| | ||
|
||
| bin | ||
| Binary scripts including `elasticsearch` to start a node | ||
and `elasticsearch-plugin` to install plugins | ||
| 二进制脚本,包括启动节点的 `elasticsearch` 和安装插件的 | ||
`elasticsearch-plugin` | ||
| /usr/share/elasticsearch/bin | ||
d| | ||
|
||
| conf | ||
| Configuration files including `elasticsearch.yml` | ||
| 包含 `elasticsearch.yml` 的配置文件 | ||
| /etc/elasticsearch | ||
| <<config-files-location,ES_PATH_CONF>> | ||
|
||
| conf | ||
| Environment variables including heap size, file descriptors. | ||
| 包含堆大小,文件描述符的环境变量。 | ||
| /etc/default/elasticsearch | ||
d| | ||
|
||
| data | ||
| The location of the data files of each index / shard allocated | ||
on the node. Can hold multiple locations. | ||
| 每个节点分配的 index / shard 数据文件。支持多路径。 | ||
| /var/lib/elasticsearch | ||
| path.data | ||
|
||
| logs | ||
| Log files location. | ||
| Log 文件路径。 | ||
| /var/log/elasticsearch | ||
| path.logs | ||
|
||
| plugins | ||
| Plugin files location. Each plugin will be contained in a subdirectory. | ||
| Plugin 文件路径。每个插件都包含在一个子目录中。 | ||
| /usr/share/elasticsearch/plugins | ||
| | ||
|
||
| repo | ||
| Shared file system repository locations. Can hold multiple locations. A file system repository can be placed in to any subdirectory of any directory specified here. | ||
d| Not configured | ||
| 共享文件系统库路径。支持多路径。一个文件系统库可以在此处指定的任何目录的任何子目录中。 | ||
d| 未配置 | ||
| path.repo | ||
|
||
|======================================================================= | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
Elasticsearch defaults to using `/etc/elasticsearch` for runtime configuration. | ||
The ownership of this directory and all files in this directory are set to | ||
`root:elasticsearch` on package installation and the directory has the `setgid` | ||
flag set so that any files and subdirectories created under `/etc/elasticsearch` | ||
are created with this ownership as well (e.g., if a keystore is created using | ||
the <<secure-settings,keystore tool>>). It is expected that this be maintained so | ||
that the Elasticsearch process can read the files under this directory via the | ||
group permissions. | ||
Elasticsearch 默认使用 `/etc/elasticsearch` 进行运行时配置。 | ||
该目录和目录中的所有文件的权限都为 `root:elasticsearch` 并且目录有 `setgid` 标志设置,以便在 `/etc/elasticsearch` 下创建任何文件和子目录 | ||
也可以使用此所有权创建(例如,如果使用创建密钥库 | ||
<<secure-settings,keystore tool>>)。Elasticsearch进程可通过组权限读取这个目录下的文件。 | ||
|
||
Elasticsearch loads its configuration from the | ||
`/etc/elasticsearch/elasticsearch.yml` file by default. The format of this | ||
config file is explained in <<settings>>. | ||
Elasticsearch 默认配置从 `/etc/elasticsearch/elasticsearch.yml` 加载 。配置文件的解释详见 <<settings>>. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
==== SysV `init` vs `systemd` | ||
|
||
Elasticsearch is not started automatically after installation. How to start | ||
and stop Elasticsearch depends on whether your system uses SysV `init` or | ||
`systemd` (used by newer distributions). You can tell which is being used by | ||
running this command: | ||
Elasticsearch 安装后不会自启动。 如何启动和停止 Elasticsearch 取决于你的系统是否使用 SysV `init` 或 `systemd` (由新发行版使用)。 | ||
你可通过以下命令知道是否运行: | ||
|
||
[source,sh] | ||
-------------------------------------------- | ||
ps -p 1 | ||
-------------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
We sign all of our packages with the Elasticsearch Signing Key (PGP key | ||
https://pgp.mit.edu/pks/lookup?op=vindex&search=0xD27D666CD88E42B4[D88E42B4], | ||
available from https://pgp.mit.edu) with fingerprint: | ||
我们使用 Elasticsearch 签名密钥对所有软件包进行指纹签名(PGP 密钥 | ||
https://pgp.mit.edu/pks/lookup?op=vindex&search=0xD27D666CD88E42B4[D88E42B4] | ||
可从https://pgp.mit.edu获得): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可从 https://pgp.mit.edu 获得): |
||
|
||
4609 5ACC 8548 582C 1A26 99A9 D27D 666C D88E 42B4 | ||
|
||
Download and install the public signing key: | ||
|
||
下载和安装公共签名密钥: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elastic Docker Registry 建议保留原文