如何为Elasticsearch6.x Reference中文版贡献翻译/审校

本文介绍了如何参与Elasticsearch 6.x Reference中文版的翻译和审校工作,包括成为贡献者所需的预备条件、创建章节分支、提交翻译更新以及进行代码审查等流程。感兴趣的读者可以通过参与翻译,为Elasticsearch中文社区贡献力量。

Elasticsearch6.x Reference中文版翻译工作已经得到官方授权并在翻译中,如有兴趣可以一起为Elasticsearch中文社区贡献自己的一份力量,最终翻译完成后中文版本将会同步到Elastic官网。

翻译流程如下,具体详见https://github.com/elasticsearch-cn/elasticsearch/wiki

Prerequisites

Prepare translation

  1. Fork the book repository to your own repository
  1. Clone the book repository

git clone git@github.com:${USER_NAME}/elasticsearch.git

  1. Add upstream to your repository
  • git remote add upstream https://github.com/elasticsearch-cn/elasticsearch.git

  • Add the “PullRequest” Git alias (macro) to your Git config edit .git/config and add the following lines:

方法一:

  • git config --global alias.pr '!f() { git fetch upstream pull/$1/head:pr/$1; }; f'
  • git config --global alias.review '!f() { git checkout cn && git pr $1 && git checkout cn && git pull --rebase upstream cn && git checkout pr/$1 && git rebase cn;}; f'

方法二:

[alias] pr = "!f() { git fetch upstream pull/$1/head:pr/$1; }; f"

[alias] review = "!f() { git checkout cn && git pr $1 && git checkout cn && git pull --rebase upstream cn && git checkout pr/$1 && git rebase cn;}; f"

  1. Catch up with latest updates:

* git checkout cn

* git pull --rebase upstream cn # upstream should point to elasticsearch-cn/elasticsearch.git.git

  • 确定好你目前正在翻译的章节,excel里面只粗分到章,原则是一个人负责一章,千万不要弄错了,先更新你的任务状态

Create a chapter branch -- Rule #1: Never work on master or cn!

*git checkout -b chapter/chapter1/getting-started.asciidocfor chapter #1 branch and the first doc in this chapter

  1. Translate

  2. Review locally ( https://github.com/elastic/docs )

git clone git@github.com:elastic/docs.git

./docs/build_docs.pl --doc getting-started.asciidoc --out es-book-output/ --open --chunk=1

  • Warning The output/dir/ will be deleted and recreated, so don’t point it at a directory with contents that you want to keep.
  1. Send pull request(elasticsearch-cn:cn from ${USER_NAME}:${USER_BRANCH})

  2. Wait for review( find some guy review for you)

  3. Review and modify

  4. Wait for merge

  5. Merge to cn branch

  6. Resource

Note about squashing commits

You should also **never squash commits during the review** process at Github, since that forces the reviewer to evaluate
hundreds of lines of code in a new, squashed commits, instead of just the changes in specific commits. In other words, during the review process, keep adding and pushing commits, and after the review is done, perform a final rebase/squash/reword/etc on the branch, before merging it.
```

git checkout your-chapter/chapters git merge-base your-chapter/chapters cn git rebase -i sha1 git rebase cn ```

Prepare push to your repo

* `git checkout cn`            # Go back to cn to get latest commits
* `git pull --rebase upstream cn` # Rebase the cn
* `git checkout chapter/chapter1`    # Go back to the translation branch
* `git rebase cn`            # Rebase feature branch using cn
* `git push origin chapter/chapter1` # Push to your remote

If you already pushed to your remote, and make changes to the history (like with rebase / squash), your push will be denied. In that case, you need to use the `--force` switch to overwrite the remote history:

```
git push origin chapter/chapter1 -f # Force push to your remote
```

Remember that it’s perfectly fine to overwrite your own history (ie. your fork, or private branch), but you must not (infact never!) overwrite shared history (ie. master, the cn branch, etc). In other words, force push to your fork or branch, but never to branches which you share with other developers and the world.

Prepare a pull-request for your fix

* Go to your Github account and open a pull request for the the branch you just committed and pushed.
  * 每个章节下面有很多页,我们可以分批提交,如第一章第一次提交的pr,(章节+部分+文件路径)标题:`chapter1_part1: /getting-started.asciidoc`
  * 如翻译完第二部分(另外一个文件)再来一个PR:`chapter2_part1: /setup/install.asciidoc`
* The pull-request will get an ID, which is the last number in the github URL:
    * https://github.com/elasticsearch-cn/elasticsearch/pull/2985

Fetch a PR and review locally

* If you are a reviewer you can pull the pull-request by running (2985 is your pr id):
    * `git review 2985`
    * or manually fetch PR
      * `git pr 2985` # Create a branch named “pr/2985” in your working copy (local)
      * `git checkout cn && git pull --rebase upstream cn` # Get latest changes
      * `git checkout pr/2985 && git rebase cn` # Rebase to latest cn
* Do your checking and review, please use web browser to view the final result
   `./docs/build_docs.pl --doc   getting-started.asciidoc  --out es-book-output/ --open --chunk=1`
* Go to pull thread and comment "LGTM"
* [DONT! do this now]`git checkout cn && git merge pr/2895` # Merge the commits into cn * [DONT! do this now]`git push upstream cn` # Push cn to the main repo  * Make sure to add the proper labels to the github issue/PR: see following section * Clean local branch `git branch -D pr/2985` * Done

Labelling pull requests & issues

  * `to be review` `review`  `to be merge` `done`

Translation Reviews

* Everybody does translation reviews.
* Everybody's translation gets reviewed before being merged.
* You should find a reviewer for your PR.
* You have to satisfy your reviewer.

As the reviewee:

When your translation is ready for review (which includes updating the documentation and modify), create a pull request on GitHub and add the `to be review` label.

Then find somebody to review your translation and assign the PR to that person.  You can find people who are interested in your PR touches in the [spreadsheet] or from QQ group: 109764489 .

Generally, most PRs should be reviewed by at least two other people:
* For the first review, try to choose a less experienced person so that they have a chance to learn.
* Once you have satisfied the first reviewer, find somebody with more experience in the area to give the final LGTM (looks good to me).
* Try not to choose the same people all the time - spread the load.
* If a reviewer takes too long, feel free to bug them or to choose a different reviewer, but it is up to you to get your PR reviewed.

Once you have two LGTM, go ahead and label your PR: 

Label your PR with `to be merged`, and with the chapter number (eg `chapter1`, `chaper2`, `chapter1_part1`)

For smaller PRs, a single review may be sufficient, but if you are not 100% sure, then make sure you get a second review.

As the reviewer:

If you have any questions, or suggestions, leave comments on the PR, remove the `review` label and unassign yourself.  It is up to the reviewee to make the appropriate corrections or to explain their choices to your satisfaction.

As part of the review, make sure that the PR is properly labelled according to the labelling section above.

Once you are satisfied, leave a LGTM (looks good to me) comment and, again, remove the `review` label and unassign your

[elk@master bin]$ ./elasticsearch-setup-passwords auto warning: ignoring JAVA_HOME=/opt/jdk/; using bundled JDK Connection failure to: http://192.168.241.150:9200/_security/_authenticate?pretty failed: 拒绝连接 ERROR: Failed to connect to elasticsearch at http://192.168.241.150:9200/_security/_authenticate?pretty. Is the URL correct and elasticsearch running?, with exit code 78 [1]+ 退出 1 nohup ./elasticsearch > /home/elasticsearch/log/elk2.log 2> 1 025-03-17T11:40:18,491][ERROR][o.e.b.Elasticsearch ] [dsports-node-1] fatal exception while booting Elasticsearch org.elasticsearch.ElasticsearchSecurityException: invalid SSL configuration for xpack.security.transport.ssl - server ssl configuration requires a key and certificate, but these have not been configured; you must set either [xpack.security.transport.ssl.keystore.path], or both [xpack.security.transport.ssl.key] and [xpack.security.transport.ssl.certificate] at org.elasticsearch.xcore@8.17.3/org.elasticsearch.xpack.core.ssl.SSLService.throwExceptionForMissingKeyMaterial(SSLService.java:686) at org.elasticsearch.xcore@8.17.3/org.elasticsearch.xpack.core.ssl.SSLService.validateServerConfiguration(SSLService.java:642) at org.elasticsearch.xcore@8.17.3/org.elasticsearch.xpack.core.ssl.SSLService.loadSslConfigurations(SSLService.java:627) at org.elasticsearch.xcore@8.17.3/org.elasticsearch.xpack.core.ssl.SSLService.<init>(SSLService.java:160) at org.elasticsearch.xcore@8.17.3/org.elasticsearch.xpack.core.XPackPlugin.createSSLService(XPackPlugin.java:496) at org.elasticsearch.xcore@8.17.3/org.elasticsearch.xpack.core.XPackPlugin.createComponents(XPackPlugin.java:325) at org.elasticsearch.server@8.17.3/org.elasticsearch.node.NodeConstruction.lambda$construct$16(NodeConstruction.java:894) at org.elasticsearch.server@8.17.3/org.elasticsearch.plugins.PluginsService.lambda$flatMap$1(PluginsService.java:254) at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.jav
最新发布
03-18
<think>好的,用户遇到了Elasticsearch 8.17.3启动时的SSL安全异常问题,具体错误是“invalid SSL configuration xpack.security.transport.ssl keystore path certificate”。我需要帮他解决这个问题。 首先,我应该回忆一下Elasticsearch的SSL配置要求。Elasticsearch 8.x开始默认启用安全特性,包括SSL/TLS加密。用户可能在配置传输层或HTTP层的SSL时路径设置不正确,或者证书文件有问题。 接下来,常见的导致这个错误的原因可能有几个:证书路径错误、证书格式不正确、文件权限问题,或者配置参数写错了。比如,keystore的路径是否绝对路径,或者相对于ES配置目录的路径是否正确。还有,是否使用了正确的配置参数名,比如xpack.security.transport.ssl.keystore.path是否正确,或者是否应该用xpack.security.http.ssl.keystore.path,这取决于配置的是传输层还是HTTP层。 然后,我需要检查步骤。用户需要确认证书文件是否存在,路径是否正确,是否具有可读权限。同时,证书的格式是否正确,比如是否是JKS或PKCS#12格式。另外,可能需要使用elasticsearch-certutil工具重新生成证书,或者检查elasticsearch.yml中的相关配置项是否拼写正确,有没有缩进错误。 另外,用户提到的是8.17.3版本,可能和引用中的8.17.0略有不同,但配置应该相似。引用中的curl命令显示了SSL证书的路径,可能用户需要确认自己的证书路径是否配置正确,是否使用了正确的CA证书。 可能的解决方案包括:重新生成证书并配置正确的路径,检查文件权限,确保所有节点配置一致,以及验证配置文件语法是否正确。此外,可能需要重启Elasticsearch服务,并在日志中查看更详细的错误信息。 需要提醒用户注意证书的生成步骤是否正确,比如是否包含了所有必要的信息,是否将证书放在正确的目录下。同时,是否在配置中启用了SSL,比如xpack.security.enabled是否设置为true,以及是否配置了传输层和HTTP层的SSL部分。 最后,总结步骤,分点列出解决方案,并建议用户检查每个可能的配置点,逐步排查问题。</think>关于Elasticsearch 8.17.3启动时出现的SSL安全异常问题,以下是逐步解决方案: ### 一、错误原因分析 该错误通常由以下原因导致: 1. **证书路径配置错误**:`xpack.security.transport.ssl.keystore.path`指定的证书文件路径无效或文件不存在 2. **证书格式不匹配**:未使用JKS或PKCS#12格式的证书 3. **权限问题**:Elasticsearch进程无权限读取证书文件 4. **配置参数冲突**:未正确区分传输层(transport)和HTTP层的SSL配置[^1] ### 二、解决方案步骤 #### 1. 验证证书文件 ```bash # 检查证书文件是否存在 ls -l /apps/usr/elasticsearch-8.17.0/config/ssl-cert/ # 确认文件权限(需elasticsearch用户可读) chmod 640 /path/to/keystore.p12 ``` #### 2. 修改elasticsearch.yml配置 ```yaml # 传输层SSL配置 xpack.security.transport.ssl: enabled: true verification_mode: certificate keystore.path: /apps/usr/elasticsearch-8.17.0/config/ssl-cert/keystore.p12 truststore.path: /apps/usr/elasticsearch-8.17.0/config/ssl-cert/truststore.p12 # HTTP层SSL配置(可选) xpack.security.http.ssl: enabled: true keystore.path: /apps/usr/elasticsearch-8.17.0/config/ssl-cert/http-keystore.p12 ``` #### 3. 重新生成证书(可选) 使用elasticsearch-certutil工具生成新证书: ```bash ./bin/elasticsearch-certutil cert -out config/ssl-cert/elastic-certificates.p12 -pass "" ``` #### 4. 配置一致性检查 所有节点必须使用相同的: - 证书文件 - 密码配置 - SSL验证模式 #### 5. 启动验证 ```bash # 前台启动观察日志 ./bin/elasticsearch # 查看详细错误日志 tail -f logs/elasticsearch.log ``` ### 三、典型配置示例 ```yaml cluster.name: es-cluster node.name: es-node1 path.data: /var/lib/elasticsearch path.logs: /var/log/elasticsearch network.host: 0.0.0.0 xpack.security.enabled: true xpack.security.transport.ssl: enabled: true verification_mode: certificate keystore.path: /path/to/keystore.p12 truststore.path: /path/to/truststore.p12 keystore.password: "密码" truststore.password: "密码" ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值