英文:
Distributed microservices using Kite and Kontrol
问题
我能够将我的风筝微服务注册到控制中心,但无法发现它。
kites, err := k.GetKites(&protocol.KontrolQuery{
Username: k.Config.Username,
Environment: k.Config.Environment,
Name: "myservice",
})
if err != nil {
fmt.Println("has error")
log.Fatalln(err)
}
我得到了一个身份验证错误。
has error
2015/06/16 09:59:16 authenticationError: token contains an invalid number of segments
exit status 1
此外,我找不到$USER_HOME/.kite/kite.key
文件。
英文:
I am able to register my kite microservice to kontrol but unable to discover it,
kites, err := k.GetKites(&protocol.KontrolQuery{
Username: k.Config.Username,
Environment:k.Config.Environment,
Name:"myservice",
})enter code here
if err != nil {
fmt.Println("has error")
log.Fatalln(err)
}
I am getting authenticationError.
has error
2015/06/16 09:59:16 authenticationError: token contains an invalid number of segments
exit status 1
Also I am not able to find $USER_HOME/.kite/kite.key
file.
答案1
得分: 1
我已经弄清楚了。我需要导出这些环境变量,
export KONTROL_PORT=4099
export KONTROL_USERNAME="kontrol"
export KONTROL_STORAGE="etcd"
export KONTROL_KONTROLURL="http://127.0.0.1:4099/kite"
export KONTROL_PUBLICKEYFILE=~/certs/key_pub.pem
export KONTROL_PRIVATEKEYFILE=~/certs/key.pem
然后生成 RSA 令牌,
cd ~/certs/
openssl genrsa -out key.pem 2048
openssl rsa -in key.pem -pubout > key_pub.pem
openssl rsa -in key.pem -pubout > key_pub.pem
使用 -install 标志运行 Kontrol CLI。
英文:
I have figured it out. I need to export these environment variable,
export KONTROL_PORT=4099
export KONTROL_USERNAME="kontrol"
export KONTROL_STORAGE="etcd"
export KONTROL_KONTROLURL="http://127.0.0.1:4099/kite"
export KONTROL_PUBLICKEYFILE=~/certs/key_pub.pem
export KONTROL_PRIVATEKEYFILE=~/certs/key.pem
Then generate rsa token,
cd ~/certs/
openssl genrsa -out key.pem 2048
openssl rsa -in key.pem -pubout > key_pub.pem
openssl rsa -in key.pem -pubout > key_pub.pem
Run Kontrol CLI with -install flag.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论