Closed agardnerIT closed 3 years ago
I got a little bit further with the JSON loader:
./gnmi-gateway -EnableGNMIServer -ServerTLSCert=server.crt -ServerTLSKey=server.key -TargetLoaders=json -TargetJSONFile=targets.json -Exporters=debug
./gnmi-gateway -EnableGNMIServer -ServerTLSCert=server.crt -ServerTLSKey=server.key -TargetLoaders=json -TargetJSONFile=targets.json -Exporters=debug
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Starting GNMI Gateway."}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Clustering is NOT enabled. No locking or cluster coordination will happen."}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Starting connection manager."}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Starting gNMI server on 0.0.0.0:9339."}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Starting Debug exporter."}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Connection manager received a target control message: 1 inserts 0 removes"}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Initializing target localhost ([127.0.0.1:50051]) map[NoTLSVerify:yes]."}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Target localhost: Connecting"}
{"level":"info","time":"2021-05-14T14:03:35+10:00","message":"Target localhost: Subscribing"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"Target localhost: Disconnected"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/sync val:&{false} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/connected val:&{false} } ] }"}
E0514 14:03:45.564881 16648 reconnect.go:114] client.Subscribe (target "localhost") failed: client "gnmi" : client "gnmi" : Dialer(127.0.0.1:50051, 10s): context deadline exceeded; reconnecting in 552.330144ms
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/targetLeavesUpdated val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/targetLeavesSuppressed val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/latencyMax val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/targetSize val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/latestTimestamp val:&{-6795364578871345152} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/latencyMin val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/targetLeavesAdded val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/targetLeavesDeleted val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/targetLeaves val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/targetLeavesStale val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:45+10:00","message":"{ timestamp:1620965025564881800 prefix:/localhost update:[ { path:/meta/latencyAvg val:&{0} } ] }"}
{"level":"info","time":"2021-05-14T14:03:56+10:00","message":"Target localhost: Disconnected"}
E0514 14:03:56.155311 16648 reconnect.go:114] client.Subscribe (target "localhost") failed: client "gnmi" : client "gnmi" : Dialer(127.0.0.1:50051, 10s): context deadline exceeded; reconnecting in 1.080381816s
{"level":"info","time":"2021-05-14T14:04:05+10:00","message":"Connection manager received a target control message: 1 inserts 0 removes"}
{"level":"info","time":"2021-05-14T14:04:07+10:00","message":"Target localhost: Disconnected"}
E0514 14:04:07.250449 16648 reconnect.go:114] client.Subscribe (target "localhost") failed: client "gnmi" : client "gnmi" : Dialer(127.0.0.1:50051, 10s): context deadline exceeded; reconnecting in 1.31013006s
{"level":"info","time":"2021-05-14T14:04:18+10:00","message":"Target localhost: Disconnected"}
E0514 14:04:18.584978 16648 reconnect.go:114] client.Subscribe (target "localhost") failed: client "gnmi" : client "gnmi" : Dialer(127.0.0.1:50051, 10s): context deadline exceeded; reconnecting in 1.582392691s
{"level":"info","time":"2021-05-14T14:04:30+10:00","message":"Target localhost: Disconnected"}
E0514 14:04:30.202416 16648 reconnect.go:114] client.Subscribe (target "localhost") failed: client "gnmi" : client "gnmi" : Dialer(127.0.0.1:50051, 10s): context deadline exceeded; reconnecting in 2.340488664s
{"level":"info","time":"2021-05-14T14:04:35+10:00","message":"Connection manager received a target control message: 1 inserts 0 removes"}
targets.json
{
"request": {
"default": {
"subscribe": {
"prefix": {
},
"subscription": [{
"path": {
"elem": [{
"name": "GetValue"
}]
}
}]
}
}
},
"target": {
"localhost": {
"addresses": [ "127.0.0.1:50051" ],
"request": "default",
"meta": {
"NoTLSVerify": "yes"
}
}
}
}
Thinking about this further, all I need is a simple demo system so that I can create my exporter.
What's the easiest way to set this up?
Fake device > gnmi gateway
then I create:
Fake device > gnmi gateway > exporter > my service
Hi Adam,
Your proposal of
device > gnmi-gateway > exporter > my service
is sound. We generally use real devices (either router hardware or containerized routers) for development. If you need help getting it running, I suggest creating the inaugural discussion :)
Looks like there is a good discussion taking place on #30 for dummy gNMI targets -- I'm going to close this issue.
I'm on Windows. I have a simple custom server built as follows running on
localhost:50051
and I'm trying to follow the instructions in this blog post. I'd like to create an Exporter but getting the error:looper.proto
server/main.go
I've created all the files:
My targets.yaml looks like this:
Running with: