Installing solr and indexing mysql

烈酒焚心 提交于 2019-12-22 09:57:57

问题


Can anyone help me with Installation of solr and configuring it to mysql table.I Have tried almost all tutorials , i tried with Jetty , also tomcat.Still getting errors like Data Handler not defined or could not find solr.It's been a week , i am trying all day


回答1:


In order to get solr running, (assuming that you've downloaded solr and extract it to a location), just navigate to the jetty folder.

Under that there should be a start.jar.

Just type in java -jar start.jar - this should start Solr under jetty. As simple as that. For all my development purposes, I use this. I wouldn't worry about Tomcat unless the app is ready to be deployed to some server.

In order to get your SOLR instance to pull data from mysql, you need the DataImportHandler configured. This documentation describes it well.

EDIT:

A google search for "solr mysql import" lead me here. It is exactly what you're after, I suppose.




回答2:


I also had the same issue and it is not easy to find simple tutorial for this. Anyway I found following tutorial and it was useful for me. http://lasithtechavenue.blogspot.com/2013/11/crawling-mysql-database-with-apache-solr.html

Thanks




回答3:


Hi Please take a look here. https://github.com/vikash32/indexing-mysql-table-into-solr

i have tried to make it less messy.




回答4:


Step1: Login to Linux and go to root folder opt ie cd /opt/

Step2: Dowload Solr-6.6.2 from the solr link and use the below command to download solr in linux

Sudo wget http://www-us.apache.org/dist/lucene/solr/6.6.2/solr-6.6.2.tgz

Step3: Extract the service installation file

Sudo tar xzf solr-6.6.2.tgz solr-6.6.2/bin/install_solr_service.sh --strip-components=2

Step4: Install solr as a service using the script

sudo bash ./install_solr_service.sh solr-6.6.2.tgz

Step5:To check solr server status

sudo service solr status

Step6:To Start Solr in Cloud mode in RHEL

Go to root directory ie cd /opt/ Then go to solr directory cd /solr

Opt/solr > sudo ./bin/solr start -c -force -s server/solr -p 8983 -z zk1:2181,zk2:2181,zk3:2181

Zk1 is the hostname or ipaddress

Step7: To Create Core on solr

Go to solr directory ie cd /opt/solr

Opt/solr > sudo ./bin/sor/create -c -p 8983,7574 -s 2 -rf 2

-s stands for no of shards -rf stands for no of replica



来源:https://stackoverflow.com/questions/17294087/installing-solr-and-indexing-mysql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!