Cluster of multiple snap store proxy instances not working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snap Store Server |
New
|
Medium
|
Unassigned |
Bug Description
The documentation (https:/
root@snap-
Store URL: http://
Store DB: ok
Store ID: *******
Status: approved
Connected Devices (updated daily): 0
Device Limit: 25
Internal Service Status:
memcached: running
nginx: running
snapauth: running
snapdevicegw: running
snapdevicegw-
snapproxy: running
snaprevs: running
root@snap-
Store URL: http://
Store DB: ok
Store ID: not registered
Internal Service Status:
memcached: running
nginx: running
snapauth: not running: 500 Server Error: INTERNAL SERVER ERROR for url: http://
snapdevicegw: running
snapdevicegw-
snapproxy: running
snaprevs: not running: 500 Server Error: INTERNAL SERVER ERROR for url: http://
The documentation also says that it is enough to register one of the cluster members, but that does not work, too. Let's have a look at the store id. It is not accessible from the database for the other node or only hold locally on the system that was registered successfully.
It it currently possible to run that service as a cluster comprising two or more instances of the Snap Store Proxy? Is there a way to loadbalance it with the help of NGINX, Apache or HAProxy?
Hi Christoph and thanks for this report!
We're aware of this and some other current limitations of this setup and are currently designing some related improvements. We will likely remove the current related documentation until this is addressed.
It should be possible to work around the db credentials issue. See:
sudo snap get snap-store-proxy internal. snaprevs. db
and
sudo snap get snap-store-proxy internal. snapauth. db
`sudo snap set ...` can be used to set the same connections string in all instances of the snap-store-proxy.
As for the registration. Only one proxy has to be registered. But others' config will have to be set based on the config of the registered one. `snap-proxy config` command can be used to both get and set all non-internal config options of the snap-store-proxy.
snap-store-proxy can be fronted with an external load balancer / reverse-proxy. However currently for it to function properly the scheme used between the end clients (devices) and the external LB has to be the same as the scheme exposed by the snap-store-proxy - meaning either http or https on both sides.