You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@linkis.apache.org by Andy <an...@163.com> on 2022/04/28 08:24:34 UTC

[DISCUSS] Gateway and LKIP

hcl🐯 10:13
@peacewong@WDS 
我们的gateway有这个问题吗
https://github.com/spring-cloud/spring-cloud-gateway/issues/1651

peacewong@WDS 10:19
报这个错后,请求会卡住吗?

legendtkl 10:19
@peacewong@WDS 和平兄,灰度发布那个,最终的状态是不是实现一个服务在 eureka 上面注册多个实例,然后利用 ribbon 将请求打到新的服务实例上面,然后再把老的服务下线。但是目前服务的启动端口是写死的,比如 gateway 是 9001,是不是要把这个端口搞成不固定的

hcl🐯 10:20
会timeout@peacewong@WDS 

peacewong@WDS 10:27
gateway可能通过VIP做多活,因为要提供给外部使用。所以这个服务应该不用做灰度的

peacewong@WDS 10:28
最好是基于注册中心的下线机制去做,这样restful和rpc请求就不会转发过去了

hcl🐯 10:28
@peacewong@WDS 这个是失败时候的日志

legendtkl 10:31
先下线,再启动新服务的话,中间会不会有段时间没有服务处理请求

W 10:33
每个服务保持多个实例就可以了

legendtkl 10:34
@wForget-爱奇艺-王震 现在服务的启动端口是固定的,如果改成多实例的话,端口这块是不是也要改成不固定的

W 10:35
可以在多台机器上面部署 [Grin]

W 10:36
改成不固定的应该也可以,都是基于 europa 做服务发现

hcl🐯 10:37
不需要

legendtkl 10:37
那单个机器上面启动的话不是端口冲突了

hcl🐯 10:38
微服务部署的话不需要

hcl🐯 10:38
那你可以多机部署

legendtkl 10:41
不能做多机部署这个假定吧,如果我是用户的话很有可能把 linkis 这些平台进程部署在一台机器上,剩下的机器资源用来跑作业

阿黎eric 10:42
@peacewong@WDS 这个cache 标签可以打吗

hcl🐯 10:43
嗯,那可能要改端口

peacewong@WDS 11:07
如果部署在一台机器上面的话,需要修改下配置的端口来着。这个应该部署的时候来决定好点。

peacewong@WDS 11:08
好的,这个是reactor的问题,有个调优参数的。稍后我发下

peacewong@WDS 11:08
哪个呢?

peacewong@WDS 11:11
@legendtkl 克路兄现在可能有个问题是比较关注的,就是entrance服务现在有运行中的任务缓存这个,这个下线后是不是可以正常跑完这些任务。以及怎么等待退出。

阿黎eric 11:13
String CACHE_KEY = "cache"; 可以的设计是用来做数据缓存?

Sargent Ti 11:26
这个确实是Linkis在设计之初,跟社区需求有点脱节的一块

Sargent Ti 11:26
包括微服务和模块的拆分,和被抱怨的复杂度

hcl🐯 11:28
@peacewong@WDS  缓存这块有考虑过用redis吗

W 11:29
我觉得最好别加依赖了,需要持久化的话可以尝试放 mysql 里面 [呲牙]

Sargent Ti 11:35
dss + linkis 涉及的中间件比较多,运维、搭建复杂,一般小公司 成本比较高; 但是 dss 里面的组件,在几千人的公司,很难支持的,光每个组件的 组织结构、权限、治理都需要改造很多。 基本都是自研了。 所以感觉两头吃力不讨好。
--这是@liangqilang_boss直聘_朱辉 之前的总结,我觉得很有代表性。对大型机构体系化治理易扩展能力不够,对中小型复杂度门槛太高。

peacewong@WDS 11:37
这个是设计做结果集缓存的,如果命中相同的查询了,且带上了这个标签,直接返回历史结果。

peacewong@WDS 11:38
赞同,接口可以定义扩展性强点

Sargent Ti 11:39
而往往一个有生命力的开源项目,是先把简单、基础的东西做扎实,再逐渐往复杂演变。
而wds实际是从webank直接拿出来开源的,现在有点上下两头都得补课。

新一 11:39
[强]

peacewong@WDS 11:40
@中国移动-hcl gateway java 启动加下这个参数下-Dreactor.netty.ioWorkerCount=50

闫 11:41
同感,特别是新手阶段,兼容性和多技术栈组件使得入门成本偏高,这很不利于产品本身的发展

海森堡 11:50
帅哥,同感呀,小公司用不起,大公司基本自研,留下就剩我们这些中型公司了[破涕为笑],有一定自研和运维能力



海森堡 11:51
平哥,我整理了下,JDBC多数据源实现的一个流程,
平哥,通过linkis-cli 执行JDBC代码,指定运行时参数 wds.linkis.jdbc.datasource=test_mysql,这个参数名称固定这个可以嘛
sh bin/linkis-cli-jdbc -code "select * from linkis_ps_configuration_config_key limit 10" -runtimeMap wds.linkis.jdbc.datasource=test_mysql

接口传参数的话
/api/rest_j/v1/entrance/submit
{
"executionContent": {"code": "select * from linkis_ps_configuration_config_key limit 10", "runType": "jdbc"},
"params": {"variable": {}, "configuration": {"runtime": {"wds.linkis.jdbc.datasource": "test_mysql"}}},
"source": {"scriptPath": ""},
"labels": {
"engineType": "jdbc-4",
"userCreator": "linkis-LINKISCLI"
}
}

然后在JDBCEngineConnExecutor中可以拿到这个参数

val properties = engineExecutorContext.getProperties.asInstanceOf[util.Map[String, String]]可以获取到:
wds.linkis.jdbc.datasource=test_mysql

wds.linkis.jdbc.datasource如果没传,走原有逻辑,
如果传了,远程去拿DataSource配置,然后创建对应数据源连接,去执行SQL
@peacewong@WDS

海森堡 11:52
剩下的就是远程拉去数据源配置,和数据库连接池的规划啦

Sargent Ti 11:52
[捂脸]我开个LKIP,下次会议一起讨论下

闫 11:53
[ThumbsUp]

peacewong@WDS 12:03
龙平兄逻辑没问题的,就是keyname,建议通用化一点,不聚焦于jdbc?然后放到runtime的时候建议在这个key的层级下

peacewong@WDS 12:07
对的在runtime加个层级

海森堡 12:10
我理解没错的话,configuration下包含
startup runtime special dataSources 并列几个大类配置,

海森堡 12:10
"params": {"variable": {}, "configuration": {"startup":{}, "runtime": {}, "dataSources": {wds.linkis.engine.datasource": "test_mysql"}}},

peacewong@WDS 12:14
要不放到run time里面去。修改少点

海森堡 12:16
明白了 我待会再调整下





hcl🐯 10:13
@peacewong@WDS 
Does our gateway have this problem?
https://github.com/spring-cloud/spring-cloud-gateway/issues/1651

peacewong@WDS 10:19
Will the request get stuck after reporting this error?

legendtkl 10:19
@peacewong@WDS Brother Heping, Grayscale released that one. Is the final state implemented to register multiple instances of a service on eureka, and then use ribbon to send requests to new service instances, and then take the old service offline. However, the current startup port of the service is hard-coded, for example, the gateway is 9001. Is it necessary to make this port unfixed?

hcl🐯 10:20
Will timeout@peacewong@WDS 

peacewong@WDS 10:27
The gateway may do more work through VIP, because it needs to be provided for external use. So this service should not need to do grayscale

peacewong@WDS 10:28
It is best to do it based on the offline mechanism of the registry, so that restful and rpc requests will not be forwarded.

hcl🐯 10:28
@peacewong@WDS  This is the log when it failed

legendtkl 10:31
If you go offline first and then start a new service, will there be no service processing requests for a while in the middle?

W 10:33
Keeping multiple instances of each service is fine

legendtkl 10:34
@wForget-iQiyi-Wang Zhen Now the startup port of the service is fixed. If it is changed to multiple instances, should the port also be changed to not fixed?

W 10:35
Can be deployed on multiple machines [Grin]

W 10:36
It should also be possible to change it to a non-fixed one, all of which are based on europa for service discovery

hcl🐯 10:37
unnecessary

legendtkl 10:37
If it is started on a single machine, it is not a port conflict.

hcl🐯 10:38
No need for microservice deployment

hcl🐯 10:38
Then you can deploy on multiple machines

legendtkl 10:41
I can't make the assumption of multi-machine deployment. If I am a user, it is very likely that the platform processes of linkis will be deployed on one machine, and the remaining machine resources will be used to run jobs.

Arieric 10:42
@peacewong@WDS Can this cache tag be hit

hcl🐯 10:43
Well, that might have to change the port

peacewong@WDS 11:07
If deployed on a machine, you need to modify the configured port. This should be decided when deploying.

peacewong@WDS 11:08
Ok, this is a reactor problem, there is a tuning parameter. I'll post it later

peacewong@WDS 11:08
Which one?

peacewong@WDS 11:11
@legendtkl  Brother Kelu may have a problem that he is more concerned about now, that is, the entry service now has a cache of running tasks, whether it can run these tasks normally after it goes offline. and how to wait to exit.

Ali eric 11:13
String CACHE_KEY = "cache"; Can the design be used for data caching?

Sargent Ti 11:26
This is indeed a part of Linkis that was a little out of touch with the needs of the community at the beginning of its design.

Sargent Ti 11:26
Including the splitting of microservices and modules, and the complexity of complaints

hcl🐯 11:28
@peacewong@WDS  Have you considered using redis for caching?

W 11:29
I think it's best not to add dependencies. If you need persistence, you can try to put it in mysql [呲tooth]

Sargent Ti 11:35
dss + linkis involves a lot of middleware, complex operation and maintenance, and construction, and generally the cost of small companies is relatively high; however, the components in dss are difficult to support in companies with thousands of people, only the organizational structure and permissions of each component. , governance needs to be transformed a lot. Basically self-study. So I feel thankless for both ends.
--This is the summary of @liangqilang_boss's direct employment _Zhu Hui , which I think is very representative. The systemic governance of large institutions is not easy to expand, and the complexity threshold for small and medium-sized enterprises is too high.

peacewong@WDS 11:37
This is designed for result set caching. If the same query is hit and this tag is attached, the historical results will be returned directly.

peacewong@WDS 11:38
Agree, interfaces can define extensibility strong points

Sargent Ti 11:39
And often a viable open source project is to make simple and basic things solid first, and then gradually evolve into complexity.
However, wds is actually open sourced directly from webank, and now it has to make up lessons at both ends.

New One 11:39
[powerful]

peacewong@WDS 11:40
@China Mobile-hcl gateway java start with this parameter -Dreactor.netty.ioWorkerCount=50

Yan 11:41
The same feeling, especially in the novice stage, compatibility and multi-technology stack components make the entry cost high, which is not conducive to the development of the product itself

Heisenberg 11:50
Handsome guy, I feel the same way. Small companies can’t afford it. Large companies basically develop their own research. We are left with medium-sized companies.

Heisenberg 11:52
The rest is to pull the data source configuration remotely and plan the database connection pool.

Sargent Ti 11:52
[covers face] I'll open an LKIP and discuss it together at the next meeting

Yan 11:53
[ThumbsUp]

peacewong@WDS 12:03
Brother Longping has no problem with the logic, that is, the keyname. It is recommended to generalize it a bit and not focus on jdbc? Then it is recommended to put it under the level of this key when it is placed in the runtime.

peacewong@WDS 12:07
Yes, add a level at runtime

Heisenberg 12:10
If I understand correctly, the configuration contains
startup runtime special dataSources Parallel configuration of several categories,

Heisenberg 12:10
"params": {"variable": {}, "configuration": {"startup":{}, "runtime": {}, "dataSources": {wds.linkis.engine.datasource": "test_mysql"}} },

peacewong@WDS 12:14
Or put it in the run time. Modify less

Heisenberg 12:16
Got it, I'll adjust it later