Search code examples
djangoelasticsearchdjango-haystackpyelasticsearch

Stable Django-Haystack + elasticsearch setup


I'm wondering what the best combination of Django-Haystack + elasticsearch + pyelasticsearch/elasticsearch-py is. I've deployed a setup using Haystack 2.1.1-dev + elasticsearch 1.1.1 + elasticsearch-py 1.0 on an Ubuntu 12.04 machine. I tried using Haystack 2.1.0 (latest stable release) with elasticsearch 1.1.1 and pyelasticsearch 0.6.1, but it kept throwing me an error saying Django-Haystack depends on pyelasticsearch; so I switched to 2.1.1-dev, which worked beautifully.

But now I'm trying deploy an instance of a Django app to a CentOS 6.5 machine (Haystack 2.1.1-dev + elasticsearch 1.1.1 + elasticsearch-py 1.0), and I'm getting the same pyelasticsearch dependency error.

Any hints or tips from someone who has deployed to CentOS would be much appreciated.


Solution

  • Got it working, seemed to be a SELinux error, fixed with:

    # setenforce 0
    

    For reference, we have these packages installed in a virtualenv:

    -e git://github.com/toastdriven/django-haystack.git@366e7489169d460d36ac4d942c22c0e97e58c26b#egg=django_haystack-master
    elasticsearch==1.0.0
    

    And elasticsearch-1.1.1-1.noarch through yum on CentOS 6

    Edit: The more general fix that doesn't broadly disable SELinux:

    # setsebool -P httpd_can_network_connect on