ckan / ideas

[DEPRECATED] Use the main CKAN repo Discussions instead:
https://github.com/ckan/ckan/discussions
40 stars 2 forks source link

Add support for multiple instances (several websites) to Ubuntu (deb) packages #256

Open Chealer opened 3 years ago

Chealer commented 3 years ago

My organization is planning to host 2 CKAN instances on the same server. So far, the only server we have with several CKAN instances has CKAN installed from source, however we would prefer to use a managed CKAN for new servers.

Unfortunately, while CKAN itself does support running any number of instances from a single code copy (according to @wardi ), the Debian packages do not support hosting several CKAN instances. At least, that's what the maintainer's guide has been claiming for at least 7 years:

You should install CKAN from package if:
[...]
You only want to run one CKAN website per server

I have no idea what specific issues prevent that, but identifying them in this ticket would be great. An old mailing list post lists the elements to consider to host several CKAN instances on a single OS.

rufuspollock commented 3 years ago

@Chealer we're running a major cluster of CKAN instances at Datopian and we are generally running on kubernetes now. Are you running on one traditional server or can you use kubernetes?

Chealer commented 3 years ago

Thank you @rufuspollock our organization is aware of the existence of containers but has no experience with Kubernetes. We are running on a "traditional" virtualized server.

amercader commented 3 years ago

@Chealer Adding support for multiple instances to the debian packages adds significant complexity so that's why is not supported out the box. But the resulting install is set up in such a way that you could run other instances in the same server (basically by placing all installed folders inside a default one (eg /usr/lib/ckan/default, /var/lib/ckan/default, /etc/ckan/default).

In theory you could parametrize this folder in the build scripts to install a CKAN instance and handle configuration files like the supervisor ones properly, but at this point I'm not sure that would be more work than managing multiple source installs. A package install is essentially a source install with the convenience of some steps being done automatically but the end result is the same.

The points listed on the old mailing list post are the main ones to take into account when running multiple CKANs. Essentially they are separate applications in different virtualenvs, which can share resources like postgres, solr or redis as long as they have different ckan.site_id values (or use different Solr cores if they need different schemas). They will need different WSGI scripts (apache or gunicorn) which will serve them on different ports internally and then at the nginx level you route the different domains / subdomains to the relevant app.

But if as you say you are already hosting multiple source installs in a single server you are already doing all this, and IMO a package install would not add major benefits to it.

Chealer commented 3 years ago

To clarify our situation, the server where we have several CKAN instances only hosts different instances of the same site, but AFAIK they are properly isolated, so yes, the problem is not feasibility, we were simply hoping for less management.

Thank you for your elaborate comment @amercader I suppose "/var/usr/lib/ckan/default" should read "/var/lib/ckan/default".