Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Plugin : ckanext harvest

Luiz Felipe F M Costa edited this page Oct 27, 2017 · 11 revisions

!ATTENTION! This plugins installer is experimental!

Install ckanext-harvest

1. Install ckanext-harvest and dependences

Enter on virtualenv and go to plugins dir:

easyckan exec
cd /usr/lib/ckan/default/src

Install ckanext-harvest, dependeces and create database tables:

pip install -e git+https://github.com/ckan/ckanext-harvest.git#egg=ckanext-harvest
cd /usr/lib/ckan/default/src/ckanext-harvest/
pip install -r pip-requirements.txt
paster --plugin=ckanext-harvest harvester initdb --config=/etc/ckan/default/development.ini

Exit from virtualenv:

exit

2. Add ckanext-harvest to config file.

easyckan exec nano /etc/ckan/default/development.ini

ckan.plugins = harvest ckan_harvester [...]
# Harvest 
ckan.harvest.mq.type = redis
ckan.harvest.mq.hostname = ckan-supervisor

2. Add Supervisor config file

Supervisor files should be placed in /etc/ckan/default/supervisor.

Redis is a key-value database with content keeped in memory. Is used by ckanext-archiver throw Celery.

easyckan exec nano /etc/ckan/easyckan/plugins/redis.supervisor

[program:redis]
command=redis-server

easyckan exec nano /etc/ckan/easyckan/plugins/harvest.supervisor

[program:harvest-gather]
command=/usr/lib/ckan/default/bin/paster --plugin=ckanext-harvest harvester gather_consumer --config=/etc/ckan/default/development.ini
logfile=/var/log/supervisor/harvest-gather.log

[program:harvest-fetch]
command=/usr/lib/ckan/default/bin/paster --plugin=ckanext-harvest harvester fetch_consumer --config=/etc/ckan/default/development.ini
logfile=/var/log/supervisor/harvest-fetch.log

[program:harvest-run]
command=sh -c "/usr/lib/ckan/default/bin/paster --plugin=ckanext-harvest harvester run --config=/etc/ckan/default/development.ini && sleep 60"
logfile=/var/log/supervisor/harvest-run.log
autorestart=true


3. Restart EasyCKAN containers

easyckan repair