Comments (9)
@gaoxinge 给到的示例 使用的是 dubbo-go v3里面默认的配置 运行确实没有问题 但是 自己替换 user的暴露的方法时候 遇到了 注册到 k8s dubbo.io/annotation
的 还是 /dubbo/com.ikurento.user.UserProvider/providers
不会根据配置文件改变.
from dubbo-go-samples.
@gaoxinge 基于你给的demo修改后的代码
from dubbo-go-samples.
看了一下 源码 修改一下 账号的配置就可以了.
apiVersion: apps/v1
kind: Deployment
metadata:
name: dserver
spec:
replicas: 2
selector:
matchLabels:
role: dserver
template:
metadata:
labels:
role: dserver
spec:
containers:
- image: 10.8.8.207:6080/rancher/dserver:v1.1
name: server
env:
- name: DUBBO_NAMESPACE
value: "default,tools"
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
imagePullPolicy: Always
serviceAccountName: dubbo-sa
配置一下 监听的这里
- name: DUBBO_NAMESPACE
value: "default,tools"
from dubbo-go-samples.
cc @sxllwx
from dubbo-go-samples.
截止到目前 自己使用最新版本的dubbo-go进行编译运行在k8s环境下直接报错
2021-06-21T14:46:11.273+0800 WARN kubernetes/client.go:178 new kubernetes client: new dubbo-registry controller: init pod informer: read value from env by key (DUBBO_NAMESPACE))
github.com/apache/dubbo-go/remoting/kubernetes.ValidateClient
/root/vendor/github.com/apache/dubbo-go/remoting/kubernetes/client.go:178
github.com/apache/dubbo-go/registry/kubernetes.newKubernetesRegistry
/root/vendor/github.com/apache/dubbo-go/registry/kubernetes/registry.go:166
github.com/apache/dubbo-go/common/extension.GetRegistry
/root/vendor/github.com/apache/dubbo-go/common/extension/registry.go:39
github.com/apache/dubbo-go/registry/protocol.getRegistry
/root/vendor/github.com/apache/dubbo-go/registry/protocol/protocol.go:86
github.com/apache/dubbo-go/registry/protocol.(*registryProtocol).Refer
/root/vendor/github.com/apache/dubbo-go/registry/protocol/protocol.go:142
github.com/apache/dubbo-go/config.(*ReferenceConfig).Refer
/root/vendor/github.com/apache/dubbo-go/config/reference_config.go:135
github.com/apache/dubbo-go/config.loadConsumerConfig
/root/vendor/github.com/apache/dubbo-go/config/config_loader.go:145
github.com/apache/dubbo-go/config.Load
/root/vendor/github.com/apache/dubbo-go/config/config_loader.go:354
main.main
/root/go-client-pure/cmd/client.go:62
runtime.main
/usr/local/go/src/runtime/proc.go:204
2021-06-21T14:46:11.273+0800 ERROR protocol/protocol.go:88 Registry can not connect success, program is going to panic.Error message is new kubernetes client: new dubbo-registry controller: init pod informer: read value from env by key (DUBBO_NAMESPACE)
github.com/apache/dubbo-go/registry/protocol.getRegistry
/root/vendor/github.com/apache/dubbo-go/registry/protocol/protocol.go:88
github.com/apache/dubbo-go/registry/protocol.(*registryProtocol).Refer
/root/vendor/github.com/apache/dubbo-go/registry/protocol/protocol.go:142
github.com/apache/dubbo-go/config.(*ReferenceConfig).Refer
/root/vendor/github.com/apache/dubbo-go/config/reference_config.go:135
github.com/apache/dubbo-go/config.loadConsumerConfig
/root/vendor/github.com/apache/dubbo-go/config/config_loader.go:145
github.com/apache/dubbo-go/config.Load
/root/vendor/github.com/apache/dubbo-go/config/config_loader.go:354
main.main
/root/go-client-pure/cmd/client.go:62
runtime.main
/usr/local/go/src/runtime/proc.go:204
panic: new kubernetes client: new dubbo-registry controller: init pod informer: read value from env by key (DUBBO_NAMESPACE)
from dubbo-go-samples.
I create a repository for k8s registry, and master branch denotes the latest (latest denotes v3.0.0-rc2 temporarily). @whitekeyboard @kms9
@kms9 To solve your error, add a dubbo namespace environment in client.yaml. This environment variable ([1], [2]) seems to be used for client to watch the namespace where server reside.
from dubbo-go-samples.
@kms9 是把下面两个文件关于user的暴露的方法都改了,但是pod的annotation的key dubbo.io/annotation
对应的value还是没有变?
- https://github.com/dubbo-x/k8s-registry/blob/a77f69b8cb8c89ac646755bb42f74d720d3d6535/server/cmd/server.go#L63
- https://github.com/dubbo-x/k8s-registry/blob/a77f69b8cb8c89ac646755bb42f74d720d3d6535/server/conf/server.yml#L29
from dubbo-go-samples.
@kms9 你的意思是:虽然改了代码和配置,但是感觉新代码没有生效,pod里面还是跑的老代码?
直接拿你的代码跑了一下,也单独建了一个分支(改了一些路径和镜像名,其他保持一致)跑了一下,新代码应该没有问题(client pod能打印出结果):
我猜测可能是:client.sh/server.sh中打完镜像,上传镜像,然后k8s去拉镜像(client-k8s.yaml/server-k8s.yaml里面是imagePullPolicy: Always
,每次都会拉镜像,写的很细节)的时候,会不会远程hub缓存了老的镜像,导致拉取下来的任然是老的镜像。
你要不每次打镜像的时候,都更新一下tag(现在一直是v1.1),然后多试几次看看。
from dubbo-go-samples.
@gaoxinge 实验了一下 代码确实可以的. 不过 貌似不支持夸namespace? 不知道是不是我配置的问题.
from dubbo-go-samples.
Related Issues (20)
- game 启动报错 HOT 1
- 如何配置accesslog
- dubbo-go generic client 3.0.4 HOT 1
- Java-server Demo 文件报错
- [Add New Sample] triple protocol with idl and pb HOT 3
- [Add New Sample] triple protocol with idl and json HOT 2
- [Add New Sample]triple protocol with hessian HOT 1
- [Add New Sample] triple protocol with msgpack HOT 1
- [Add New Sample] config file (dubbogo.yml) HOT 1
- [Add New Sample] java interop - service discovery HOT 2
- [Add New Sample] java interop - triple protocol HOT 1
- [Add New Sample] java interop - dubbo protocol HOT 1
- [Add New Sample] triple and grpc interop HOT 2
- [Add New Sample] ecosystem - gateway HOT 1
- [Add New Sample] ecosystem - sentinel
- [Add New Sample] ecosystem - seata HOT 1
- 使用泛化示例,dubbo-go3.1.1 调用 java server 2.6.x,提示 No provider available for the service HOT 1
- master分支下的helloworld示例正常,但是java_interop/protobuf-triple/java/java-client无法运行 HOT 5
- java_interop示例下的Java-server和java-client之间不能互通,二者使用的dubbo.version也不一样,太粗糙了! HOT 2
- helloworld/README.md curl part run fail
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dubbo-go-samples.