You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/01/02 05:40:13 UTC

[GitHub] JaredTan95 closed pull request #20: 添加关于elasticsearch 因basic验证导致skywalking无法调用问题

JaredTan95 closed pull request #20: 添加关于elasticsearch 因basic验证导致skywalking无法调用问题
URL: https://github.com/apache/incubator-skywalking-website/pull/20
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/zh/blog/2019-01-12-skywalking-elasticsearch-basic.md b/docs/zh/blog/2019-01-12-skywalking-elasticsearch-basic.md
new file mode 100644
index 0000000..a739dcb
--- /dev/null
+++ b/docs/zh/blog/2019-01-12-skywalking-elasticsearch-basic.md
@@ -0,0 +1,61 @@
+### 关于使用elasticsearch,需要basic认证问题
+
+skywalking依赖elasticsearch集群,如果elasticsearch安装有x-pack插件的话,那么就会存在一个Basic认证,导致skywalking无法调用elasticsearch,解决方法是使用nginx做代理,让nginx来做这个Basic认证,那么这个问题就自然解决了。
+
+方法如下:
+
+1.安装nginx
+
+> yum install -y nginx
+
+
+2.配置nginx
+
+```xml
+
+
+server {
+        listen       9200 default_server;
+        server_name  _;
+        
+        location / {
+                 proxy_set_header Host $host;
+                 proxy_set_header X-Real-IP $remote_addr;
+                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+                 proxy_pass http://localhost:9200;
+                 #Basic字符串就是使用你的用户名(admin),密码(12345)编码后的值
+                 #注意:在进行Basic加密的时候要使用如下格式如:admin 123456 注意中间有个空格,如果使用其它格式,那么结果我们是无法预知的,最起码笔者使用上诉格式没有出现问题。
+                 proxy_set_header Authorization "Basic YWRtaW4gMTIzNDU2";
+        }
+    }
+
+
+```
+
+3.验证
+
+> curl localhost:9200
+
+```xml
+{
+  "name" : "Yd0rCp9",
+  "cluster_name" : "es-cn-4590xv9md0009doky",
+  "cluster_uuid" : "jAPLrqY5R6KWWgHnGCWOAA",
+  "version" : {
+    "number" : "6.3.2",
+    "build_flavor" : "default",
+    "build_type" : "tar",
+    "build_hash" : "053779d",
+    "build_date" : "2018-07-20T05:20:23.451332Z",
+    "build_snapshot" : false,
+    "lucene_version" : "7.3.1",
+    "minimum_wire_compatibility_version" : "5.6.0",
+    "minimum_index_compatibility_version" : "5.0.0"
+  },
+  "tagline" : "You Know, for Search"
+}
+
+
+```
+
+## 看到如上结果那么恭喜你成功了。
diff --git a/docs/zh/blog/README.md b/docs/zh/blog/README.md
index a15cd7c..8341594 100755
--- a/docs/zh/blog/README.md
+++ b/docs/zh/blog/README.md
@@ -3,6 +3,11 @@ layout: LayoutBlog
 
 blog: 
 
+- title: 关于elasticsearch因basic认证导致skywalking无法正常调用接口问题
+  name: 2019-01-12-skywalking-elasticsearch-basic.md
+  time: 刘离勇
+  short: elasticsearch basic验证
+  
 - title: SkyWalking源码解析合集
   name: 2018-12-21-SkyWalking-source-code-read
   time: 芋道源码 整理,12月21日,2018
@@ -21,4 +26,4 @@ blog:
 - title: Apache SkyWalking 为.NET Core带来开箱即用的分布式追踪和应用性能监控
   name: 2018-05-24-skywalking-net
   time: 刘浩扬
-  short: 用于SkyWalking的.NET Core SDK
\ No newline at end of file
+  short: 用于SkyWalking的.NET Core SDK


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services