简体   繁体   中英

can't connect to solr server when rebuilding index for django haystack

I am getting the following error:

Failed to add documents to Solr: Failed to connect to server at ' http://example.com/:8983/solr/update/?commit=true ', are you sure that URL is correct? Checking it in a browser might help: HTTPConnectionPool(host='example.com', port=80): Max retries exceeded with url: /:8983/solr/update/?commit=true (Caused by : [Errno 111] Connection refused)

I can hit the commit=true address which returns this xml: 在此处输入图片说明

I can hit the solr admin with no problem: 在此处输入图片说明

I have opened all ports in my security group especially 8983 and 80.

Here is my settings entry:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': 'http://example.com/:8983/solr',
        'TIMEOUT': 60 * 5,
    },
}

Why can't I connect to rebuild the index?

The problem was here:

'URL': 'http://example.com/:8983/solr',

It should be this:

'URL': 'http://example.com:8983/solr',

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM