429463267 最近的时间轴更新
429463267

429463267

技术控拯救世界
V2EX 第 197226 号会员,加入于 2016-10-20 11:04:15 +08:00
1 G 78 S 54 B
根据 429463267 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
429463267 最近回复了
完全一样的情况,马上 30 了,相亲见过很多女生,基本都不是很热情,回复冷淡,而且大多没啥素质。
@Morriaty
下载源码看了一眼,有很多依赖都是来自一个 infini.sh 的站点,然鹅,这个站点已经无法访问了。所以二次开发受阻。
@Morriaty 谢谢老哥,我去围观下
https://www.cnblogs.com/zhoujie/p/kong2.html

看了 kong 的文档,发现他的 路由能力太弱了,无法解析请求体。
@plko345

这是我用 fiddler 抓到的包,详细记录了 spark 使用 ESHaghilevelClient 写入数据的 HTTP 报文:

```http

### spark ESOperator 写入
POST http://1.2.3.4:9200/_bulk?timeout=1m HTTP/1.1
Content-Length: 500
Content-Type: application/json
Host: 1.2.3.4:9200
Connection: Keep-Alive
User-Agent: Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181)
Authorization: Basic ***

{"index":{"_index":"index2","_id":"3"}}
{"content":"这是内容 3","doc_id":3,"headline":"标题 3"}
{"index":{"_index":"index2","_id":"4"}}
{"content":"这是内容 4","doc_id":4,"headline":"标题 4"}
{"index":{"_index":"index1","_id":"1"}}
{"content":"这是内容 1","doc_id":1,"headline":"标题 1"}
{"index":{"_index":"index1","_id":"2"}}
{"content":"这是内容 2","doc_id":2,"headline":"标题 2"}
{"index":{"_index":"index1","_id":"1"}}
{"content":"这是内容 5","doc_id":1,"headline":"标题 5"}

### 响应
HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 928

{"took":1731,"errors":false,"items":[{"index":{"_index":"index2","_type":"_doc","_id":"3","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":0,"_primary_term":1,"status":201}},{"index":{"_index":"index2","_type":"_doc","_id":"4","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":1,"_primary_term":1,"status":201}},{"index":{"_index":"index1","_type":"_doc","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":0,"_primary_term":1,"status":201}},{"index":{"_index":"index1","_type":"_doc","_id":"2","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":1,"_primary_term":1,"status":201}},{"index":{"_index":"index1","_type":"_doc","_id":"1","_version":2,"result":"updated","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":2,"_primary_term":1,"status":200}}]}
###

### ESClient 删除 index
DELETE http://12.3.4:9200/index1 HTTP/1.1
Content-Length: 0
Host: 1.2.3.4:9200
Connection: Keep-Alive
User-Agent: Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181)
Authorization: Basic ***

### 响应
HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 21

{"acknowledged":true}
###
```

初步想法是解析 ReqBody,然后根据 index 名称拆分为多个 http 请求发到对应的 ES 集群上,最后响应全部结果给客户端。
但是响应的报文格式应该是无法兼容 ESHighLevelClient 。。。
@defunct9 https://sm.ms/image/Msbm1uINDnLAl5d

traefik 看上去略显弱势
@tanxnative 如果只有一个集群的话,可以通过分片算法来分发数据,
但是多个集群之间,目前没有现成方案。
@plko345 没在 k8s,在 AWS 服务器上
关于   ·   帮助文档   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2061 人在线   最高记录 5497   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 9ms · UTC 12:33 · PVG 20:33 · LAX 05:33 · JFK 08:33
♥ Do have faith in what you're doing.