You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Vincent Bossuet <bo...@free.fr> on 2020/11/06 16:30:11 UTC
can't connect to SOLR with JDBC url
Hi all :)
I'm trying to connect to Solr with JDBC, but I always have
"java.util.concurrent.TimeoutException: Could not connect to ZooKeeper
localhost:9983/ within 15000 ms" (or other port, depends wich jdbc url I
test).
Here what I did :
-
I installed Solr 7.7.2 (i followed install doc here
<https://lucene.apache.org/solr/guide/7_2/installing-solr.html>), i.e.
download, extract, start (without option : bin/solr start). This version of
Solr is the one I have at work, so i installed the same to test before on
localhost.
-
I added a 'test' collection and the examples xml documents, I can see
them at this url <http://localhost:8983/solr/test/select?q=*%3A*>
-
then I installed DbVisualizer, added driver and a connection, like explained
here
<https://lucene.apache.org/solr/guide/7_2/solr-jdbc-dbvisualizer.html> =>
the only differences I saw with documentation is that on screencopy with
the jar to import, versions are differents and there is one more jar in
solr archive (commons-math3-3.6.1.jar). Also, the jdbc url to use is with
or without a '/' in the middle (see here
<http://jdbc:solr//localhost:9983?collection=test>), as this :
jdbc:solr://localhost:9983?collection=test or
jdbc:solr://localhost:9983/?collection=test. I don't know if it is
important...
-
and I tried both on Ubuntu VM and Windows 10
So, all seems to be installed correctly, as in documentation, but when I
click on 'connect', always have a timeout. Every website where I found some
info talk about an url with 9983 port, I tried other possibilities (just in
case) but no success...
- jdbc:solr://localhost:9983?collection=test
- jdbc:solr://127.0.0.1:9983?collection=test
- jdbc:solr://localhost:9983/?collection=test
- jdbc:solr://localhost:9983/solr?collection=test
- jdbc:solr://localhost:8983/?collection=test
- jdbc:solr://localhost:8983?collection=test
- jdbc:solr://localhost:8983/solr?collection=test
- jdbc:solr://localhost:2181?collection=test
- jdbc:solr://localhost:2181/?collection=test
- jdbc:solr://localhost:2181/solr?collection=test
If you have an idea, thanks for help !
Vincent
Re: can't connect to SOLR with JDBC url
Posted by Vincent Bossuet <bo...@free.fr>.
Thank you Kevin, I can now connect (I test with DbVisualiser) with -c
option.
Vincent
Le lun. 9 nov. 2020 à 16:30, Kevin Risden <kr...@apache.org> a écrit :
> >
> > start (without option : bin/solr start)
>
>
> Solr SQL/JDBC requires Solr Cloud (running w/ Zookeeper) since streaming
> expressions (which backs the Solr SQL) requires it.
>
> You should be able to start Solr this way to get Solr in cloud mode.
>
> bin/solr start -c
>
> If you use the above to start Solr, the embedded ZK is on localhost:9983 so
> the JDBC connection string should be:
>
> jdbc:solr://localhost:9983?collection=test
>
> Assuming your collection name is test.
>
> Kevin Risden
>
>
> On Fri, Nov 6, 2020 at 11:31 AM Vincent Bossuet <bo...@free.fr> wrote:
>
> > Hi all :)
> >
> > I'm trying to connect to Solr with JDBC, but I always have
> > "java.util.concurrent.TimeoutException: Could not connect to ZooKeeper
> > localhost:9983/ within 15000 ms" (or other port, depends wich jdbc url I
> > test).
> >
> > Here what I did :
> >
> > -
> >
> > I installed Solr 7.7.2 (i followed install doc here
> > <https://lucene.apache.org/solr/guide/7_2/installing-solr.html>),
> i.e.
> > download, extract, start (without option : bin/solr start). This
> > version of
> > Solr is the one I have at work, so i installed the same to test before
> > on
> > localhost.
> > -
> >
> > I added a 'test' collection and the examples xml documents, I can see
> > them at this url <http://localhost:8983/solr/test/select?q=*%3A*>
> > -
> >
> > then I installed DbVisualizer, added driver and a connection, like
> > explained
> > here
> > <https://lucene.apache.org/solr/guide/7_2/solr-jdbc-dbvisualizer.html
> >
> > =>
> > the only differences I saw with documentation is that on screencopy
> with
> > the jar to import, versions are differents and there is one more jar
> in
> > solr archive (commons-math3-3.6.1.jar). Also, the jdbc url to use is
> > with
> > or without a '/' in the middle (see here
> > <http://jdbc:solr//localhost:9983?collection=test>), as this :
> > jdbc:solr://localhost:9983?collection=test or
> > jdbc:solr://localhost:9983/?collection=test. I don't know if it is
> > important...
> > -
> >
> > and I tried both on Ubuntu VM and Windows 10
> >
> > So, all seems to be installed correctly, as in documentation, but when I
> > click on 'connect', always have a timeout. Every website where I found
> some
> > info talk about an url with 9983 port, I tried other possibilities (just
> in
> > case) but no success...
> >
> > - jdbc:solr://localhost:9983?collection=test
> > - jdbc:solr://127.0.0.1:9983?collection=test
> > - jdbc:solr://localhost:9983/?collection=test
> > - jdbc:solr://localhost:9983/solr?collection=test
> > - jdbc:solr://localhost:8983/?collection=test
> > - jdbc:solr://localhost:8983?collection=test
> > - jdbc:solr://localhost:8983/solr?collection=test
> > - jdbc:solr://localhost:2181?collection=test
> > - jdbc:solr://localhost:2181/?collection=test
> > - jdbc:solr://localhost:2181/solr?collection=test
> >
> > If you have an idea, thanks for help !
> >
> > Vincent
> >
>
Re: can't connect to SOLR with JDBC url
Posted by Kevin Risden <kr...@apache.org>.
>
> start (without option : bin/solr start)
Solr SQL/JDBC requires Solr Cloud (running w/ Zookeeper) since streaming
expressions (which backs the Solr SQL) requires it.
You should be able to start Solr this way to get Solr in cloud mode.
bin/solr start -c
If you use the above to start Solr, the embedded ZK is on localhost:9983 so
the JDBC connection string should be:
jdbc:solr://localhost:9983?collection=test
Assuming your collection name is test.
Kevin Risden
On Fri, Nov 6, 2020 at 11:31 AM Vincent Bossuet <bo...@free.fr> wrote:
> Hi all :)
>
> I'm trying to connect to Solr with JDBC, but I always have
> "java.util.concurrent.TimeoutException: Could not connect to ZooKeeper
> localhost:9983/ within 15000 ms" (or other port, depends wich jdbc url I
> test).
>
> Here what I did :
>
> -
>
> I installed Solr 7.7.2 (i followed install doc here
> <https://lucene.apache.org/solr/guide/7_2/installing-solr.html>), i.e.
> download, extract, start (without option : bin/solr start). This
> version of
> Solr is the one I have at work, so i installed the same to test before
> on
> localhost.
> -
>
> I added a 'test' collection and the examples xml documents, I can see
> them at this url <http://localhost:8983/solr/test/select?q=*%3A*>
> -
>
> then I installed DbVisualizer, added driver and a connection, like
> explained
> here
> <https://lucene.apache.org/solr/guide/7_2/solr-jdbc-dbvisualizer.html>
> =>
> the only differences I saw with documentation is that on screencopy with
> the jar to import, versions are differents and there is one more jar in
> solr archive (commons-math3-3.6.1.jar). Also, the jdbc url to use is
> with
> or without a '/' in the middle (see here
> <http://jdbc:solr//localhost:9983?collection=test>), as this :
> jdbc:solr://localhost:9983?collection=test or
> jdbc:solr://localhost:9983/?collection=test. I don't know if it is
> important...
> -
>
> and I tried both on Ubuntu VM and Windows 10
>
> So, all seems to be installed correctly, as in documentation, but when I
> click on 'connect', always have a timeout. Every website where I found some
> info talk about an url with 9983 port, I tried other possibilities (just in
> case) but no success...
>
> - jdbc:solr://localhost:9983?collection=test
> - jdbc:solr://127.0.0.1:9983?collection=test
> - jdbc:solr://localhost:9983/?collection=test
> - jdbc:solr://localhost:9983/solr?collection=test
> - jdbc:solr://localhost:8983/?collection=test
> - jdbc:solr://localhost:8983?collection=test
> - jdbc:solr://localhost:8983/solr?collection=test
> - jdbc:solr://localhost:2181?collection=test
> - jdbc:solr://localhost:2181/?collection=test
> - jdbc:solr://localhost:2181/solr?collection=test
>
> If you have an idea, thanks for help !
>
> Vincent
>