Dependencies - NYULibraries/privileges GitHub Wiki

The application implements Solr with Sunspot for indexing and memcached with Dalli for robust caching.

Solr with Sunspot

Sunspot is included in the bundler and can be installed with a bundler install. In the qa, staging and production environments we use WebSolr to host our Solr instances in the cloud.

In the development and test environments you can use the Solr bundled with Sunspot by running:

~$ bundle exec sunspot-solr start -p 8984

Where -p 8984 indicates the local port on which you want to run it. You should change this port based on your local setup and to match any existing VCR cassettes on rerun.

You can then reindex from your database environment into this solr environment by running the following from your command line:

~$ RAILS_ENV={rails_env} bundle exec rake sunspot:reindex[500]

Where 500 is the batch size and rails_env indicates which Solr index to push to (defaults to development which should be the same as the sunspot-solr instance you started above).

Memcached with Dalli

Memcached needs to be installed manually on the application server. See http://memcached.org/.

If you wish to use Dalli/memcached instead of the built-in caching server instead of memcached ensure the following line in in place in the relevant environment file (e.g. development.rb, production.rb):

config.cache_store = :dalli_store, 'localhost:11211'

To ensure that memcached is running on your server run the command

~$ /etc/init.d/memcached status

And then start it up if it is not running

~$ /etc/init.d/memcached start

Its presence in init.d should indicate that it is set to run on startup.