Open satishviswanathan opened 6 years ago
What do you have in your KV at /fabio/config
? The attached log looks like it is reading your command line parameters correctly. That only leaves the contents of the keystore unknown.
Are you referring to the KV store in consul? attaching the consul KV
Yes, but what is inside the /fabio/config
path.
I'm sorry would you be able to guide me where to find this?
Navigate to fabio/config
in your key store. Something like: http://10.208.6.98:8500/ui/#/dc1/kv/fabio/config/edit
When I access the url I'm getting this error.
Sorry, that was just an example ... you're actual path might be different depending on your datacenter name. Really I was just wanting to know if you had anything in your consul KV store under fabio/config
. That's the default path for additional configuration and what I see being used in the log segment you attached.
"Addr": "10.208.6.98:8500",
"Scheme": "http",
"Token": "",
"KVPath": "/fabio/config",
"NoRouteHTMLPath": "/fabio/noroute.html",
Ohh, I think I may see the issue ... can you try leaving registry.consul.tagprefix
as the default value? Also the default consul address is localhost (127.0.0.1) ... so you shouldn't need to pass registry.consul.addr
as it looks like you have consul and fabio running on the same host.
Currently I was trying to get it working on my dev box which is Windows operating system and I have both Consul and Fabio running on the same box but I'm using my machine IP instead of localhost (127.0.0.1)
You should be able to start consul agent -dev
and fabio
on the same machine without any other options and get a working example. The addition of proto=tcp
is also telling fabio to run as a TCP load balancer vs an HTTP load balancer.
Literally...
Window 1:
consul agent -dev
Window 2:
fabio
You are right we can start consul agent -dev but that will use localhost right, but I want to use my machine IP
Am I missing any configuration here, any help is highly appreciated
@magiconair
@satishviswanathan I think you need to start with a known clean state and then add as you progress. The errors you are seeing don't make sense with a clean configuration.
I've now started clean
fabio-1.5.8-go1.10-windows_amd64.exe -proxy.addr :2302;proto=tcp Fabio-log1.txt
fabio-1.5.8-go1.10-windows_amd64.exe -proxy.addr :2302;proto=tcp -registry.consul.tagprefix urlprefix-:2302 Fabio-log2.txt
Ahh, okay so ... what do your service registrations look like? What is your urlprefix
tag on the service?
Thank you for your support.
This is the config I've used for service registration. Register-Service.txt
You don’t need to set the registry.consul.urlprefix option. That is only necessary if the tags do not start with ‘urlprefix-‘
Other than that this looks fine. Probably a good idea to print out the bad line as well. I’ll make a change.
When I remove the option registry.consul.urlprefix I get the following error.
syntax error: 'route add' invalid
Yeah. I don’t know. I’ll update the error reporting. If you are comfortable building fabio from source you can do that as well.
https://github.com/fabiolb/fabio/blob/master/route/parse_new.go#L85
Then run ‘make’ or ‘go build’ to build fabio
Thank you. I added the log and identified that while registering the consul service I had a "space" in the name. eg: "Service Check 1" which was causing the issue.
Now when i start fabio i can see the routes getting added. But when i access from my client application I'm getting the following error.
-registry.consul.addr 10.203.xxx.xx:8500 -proxy.addr :2302;proto=tcp
[WARN] No route for 10.203.xxx.xx:2302/v1/kv/orleans/Order_Cluster1?recurse
Try urlprefix-:2302 proto=tcp
as tag when you register the service. Otherwise this is an HTTP service.
My consul service registration is having urlprefix
{
"ID": "ServiceCheck1",
"Name": "ServiceCheck1",
"Notes": "serviceService 1",
"Address": "10.208.x.xx",
"Port": 11111,
"Tags": ["urlprefix-:2302 proto=tcp"],
"EnableTagOverride": false,
"Check":{
"DeregisterCriticalServiceAfter": "90m",
"TCP": "10.208.x.xx:11111",
"Interval": "10s"
}
}
while running fabio do I need to get this same option too?
2018/04/20 10:57:20 [INFO] HTTP proxy listening on :2302
2018/04/20 10:57:20 [INFO] Access logging disabled
2018/04/20 10:57:20 [INFO] Using routing strategy "rnd"
2018/04/20 10:57:20 [INFO] Using route matching "prefix"
2018/04/20 10:57:20 [INFO] consul: Registered fabio as "fabio"
2018/04/20 10:57:20 [INFO] consul: Registered fabio with id "fabio-9998"
2018/04/20 10:57:20 [INFO] consul: Registered fabio with address "10.203.xxx.xx"
2018/04/20 10:57:20 [INFO] consul: Registered fabio with tags ""
2018/04/20 10:57:20 [INFO] consul: Registered fabio with health check to "http://[10.203.106.62]:9998/health"
2018/04/20 10:57:20 [INFO] Config updates
+ route add ServiceCheck1:2302 tcp://10.208.x.xx:11111
Now when I access 10.203.xxx.xx:2302
from my client application, I'm getting the following error
No route for 10.203.xxx.xx:2302/v1/kv/orleans/Cluster1?recurse
This is still starting the HTTP listener instead of the TCP.
2018/04/20 10:57:20 [INFO] HTTP proxy listening on :2302
This is most likely an issue with semicolon in the proxy.addr
parameter. Unfortunate choice of separators :(
Try this:
fabio -proxy.addr ':2302;proto=tcp'
and you should see
2018/04/20 20:30:52 [INFO] TCP proxy listening on :2302
@satishviswanathan Thanks for being patient and persistent!
I'm using the following command where I've mentioned the proto as tcp -registry.consul.addr 10.203.xxx.xx:8500 -proxy.addr :2302;proto=tcp
But still the log shows [INFO] TCP proxy listening on :2302
Not sure what I'm missing
Got it, my mistake I was missing the quotes 10.203.xxx.xx:8500 -proxy.addr : '2302;proto=tcp'
Now trying to get the client connected via fabio
Now when my client application try to connect to fabio @ port 2302, I'm getting the following error.
tcp: read tcp 10.xxx.x.xx:50690->10.xxx.x.xx:11111: wsarecv: An existing connection was forcibly closed by the remote host.
One of my service is running @ 10.xxx.x.xx:11111 and it is also listed in fabio routing table.
Please advice what can be done to resolve this issue.
I'm new to Fabio and trying to set with following configuration but getting warning "syntax error: 'route add' invalid"
This is the command I've used in windows.
fabio-1.5.8-go1.10-windows_amd64.exe -registry.consul.addr 10.208.x.xx:8500 -proxy.addr :2302;proto=tcp Fabi log Fabio-log.txt