Support Questions

Find answers, ask questions, and share your expertise

Connecting to Solrcloud from Hue

Explorer

We like to connect to SolrCloud from Hue. 

 

By putting this configuration

 

[search]

# URL of the Solr Server

solr_url=http://SOLR_HOST:8983/solr

 

we could connect to the host and can see the shards of the indexes living in that host. 

 

But we want to connect to ZooKeeper coordination service ensemble  and we want to get the shards of all the indexes from every host in Solrcloud.

 

Hue is started as a service through Cloudera Manager. But our SolrCloud is running outside Cloudera Manager cluster in another set of nodes. Can you please how do I point to zookeeper ensemble?

 

Thanks. 

 

 

 

 

2 ACCEPTED SOLUTIONS

Ha I see, I just repro-ed it!

There is a problem about how we list the collections that does not seem to
work with upstream Solr.

We are fixing this in this jira: https://issues.cloudera.org/browse/HUE-2961

In your code if you replace the collection function by the content of
collection2 it should work:
https://github.com/cloudera/hue/blob/master/desktop/libs/libsolr/src/libsolr/api.py#L433

Romain

View solution in original post

Yes, with the correct indentation!

And the last thing would be to remove the

'.key()'

of

https://github.com/cloudera/hue/blob/master/apps/search/src/search/search_controller.py#L121

and it should work (I just tested it on upstream Solr 5.3)

Romain

View solution in original post

12 REPLIES 12

Hue will pull only the cores/shards of the Solr it is pointing too.

All the collections will appear normally though.

Does it answer your question?

Romain

Explorer

Thanks Romain for your quick reply.

 

When I connect to the host using solr_url, I only see shards/ replicas from that host. 

How will this host I am pointing to, knows about all the collections in solrcoud?

 

Zookeeper will have that information. And we are not pointing to zookeeper in Hue.

 

Am I missing something here? Can you please help?

 

Thanks.

 

If Solr is configured in Cloud mode, this will be automatic. Are you really
in Cloud mode (Cloud section in the left menu of http://localhost:8983/solr
)?

Romain

Explorer

 

This is how we bring up Solr instances  (Solrcloud outside Cloudera Manager)

 

bin/solr start -e cloud -z iphost-10-0-1-01:2181,iphost-10-0-1-02:2181,iphost-10-0-1-03:2181

 

and this is our Zookeeper ensemble,

 

iphost-10-0-1-01:2181,iphost-10-0-1-02:2181,iphost-10-0-1-03:2181

 

We do have "-e cloud" to say this is cloud

 

As I stated before, Hue is running inside our Cloudera cluster and has it's own Zookeeper ensemble running inside Cloudera. 

 

Thanks for looking into this!

Explorer

Hi Romain,

 

I can confirm solr is running in cloud mode.  I also see cloud on the left side in Solr UI.

I don't think there are any issues with our Solrcloud installation, as we could connect to the same solrcloud

from fusion product (from Lucidworks) and we can see all Solr collections.

We connected using Zookeeper ensemble in Fusion case. 

 

Thanks!

 

Ha I see, I just repro-ed it!

There is a problem about how we list the collections that does not seem to
work with upstream Solr.

We are fixing this in this jira: https://issues.cloudera.org/browse/HUE-2961

In your code if you replace the collection function by the content of
collection2 it should work:
https://github.com/cloudera/hue/blob/master/desktop/libs/libsolr/src/libsolr/api.py#L433

Romain

Explorer

Romain,

 

Thanks for creating a JIRA ticket and also information about the fix. 

 

Just to confirm, you basically want me to do this, right? Thanks again!

 

 

def collections(self):
try:
params = self._get_params() + (
('action', 'LIST'),
('wt', 'json'),
)
return self._root.get('admin/collections', params=params)['collections']
except RestException, e:
raise PopupException(e, title=_('Error while accessing Solr'))

 

 

 

Yes, with the correct indentation!

And the last thing would be to remove the

'.key()'

of

https://github.com/cloudera/hue/blob/master/apps/search/src/search/search_controller.py#L121

and it should work (I just tested it on upstream Solr 5.3)

Romain

Explorer

Thanks Romain! I made both the changes you outlined and it works now. I can see the collections.

 

I will be doing more testing and will let you know, if we see any other issues.

 

Thank you so much.

 

It is there, look for the correct file path:
https://github.com/cloudera/hue/blob/cdh5.4.1-release/apps/search/src/search/search_controller.py#L1...

And FYI no need to compile, just editing and restarting Hue is enough

Romain

Explorer

Yes, it is there. It is working. Thank you so much Romain! 

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.