In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to access the browse page of solr4.2". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Page 24 of solr's reference book "Apache Solr 3 Enterprise Search Server" talks about the sample browse Interface and gives a cool picture.
This function is implemented in solr. But according to the URL in the book, http://localhost:8983/solr/browse access reported an error, lazy loading error.
Referring to the online blog, I configured it myself, and it took me several days to get it done. Write down the details of the process.
First of all, the related tools I use are: win7 (32-bit flagship version) + Tomcat6.0 + solr4.2.0.
The installation directory of Tomcat6.0 is D:\ Tomcat6.0 (please note that there are no spaces), and the configured port is: 8983
If you do not configure the port, your Solr server is up and running, but it does not have any data. With the Posting command, you can modify the index of Solr: add (or modify) documents, delete documents, and submit add or delete. These commands support multiple formats (variety of formats).
The directory exampledocs contains sample files that show a variety of commands acceptable to Solr, as well as a java tool to submit these commands on the terminal (and a shell script post.sh, in this manual, we use a cross-platform Java client).
Open a new terminal window, enter the exampledocs directory, and then run "java-jar post.jar" in some XML files in the same directory.
The following error may be prompted:
SimplePostTool: FATAL: IOException while posting data: java.net.ConnectException: Connection refused: connect
Because solr uses port 8983 by default, port 8080 is used here, of course, an error will be reported, use the following command
Java-jar post.jar-h
Java-Durl= http://localhost:8080/solr/update-jar post.jar * .xml
Step 1: create a folder xh_solr under the root of the D disk and two directories under the xh_solr directory: apache-solr-4.2 and tomcat-solr. Then copy the solr-4.2.0.war file in the solr-4.2.0\ dist directory in the solr-4.2.0.zip extracted file to the D:\ xh_solr\ apache-solr-4.2 directory, and copy the solr folder in the solr-4.2.0\ example directory in the solr-4.2.0.zip unzipped file to the D:\ xh_solr\ tomcat-solr directory.
Step 2: modify the configuration of tomcat.
Create the Catalina\ localhost\ solr.xml directory and files under the D:\ Tomcat6.0\ conf directory. The Solr.xml file is as follows:
Step 3: start Tomcat. If the configuration is normal, the solr folder is automatically generated in the D:\ Tomcat6.0\ webapps directory after Tomcat starts. In fact, you unzip D:\ xh_solr\ apache-solr-4.2\ solr-4.2.0.war to the D:\ Tomcat6.0\ webapps directory. Open the browser and type: localhost:8983/solr will take you to the familiar solr home page.
Step 4: create the webapps directory in the D:\ xh_solr directory and cut the solr folder in the D:\ Tomcat6.0\ webapps directory to the D:\ xh_solr\ webapps directory. (stop tomcat is required before cutting). Then delete the Catalina directory under the D:\ Tomcat6.0\ conf directory.
Step 5: configure server.xml in the D:\ Tomcat6.0\ conf directory. Add under the node:
……
Then configure the web.xml file in the D:\ xh_solr\ webapps\ solr\ WEB-INF directory, and configure the path to solr/home: remove the comments from lines 40 to 46 of web.xml. As follows:
Solr/home/ put/your/solr/home/here java.lang.String
Then change it to:
Solr/home D:\ xh_solr\ tomcat-solr\ solr java.lang.String
Then start Tomcat, and if the configuration is successful, you can access the main page of solr without typing http://127.0.0.1:8983/ in the browser (note that it is no longer localhost).
At this point, we visit: http://127.0.0.1:8983/browse will report the following error:
The error page is still spectacular. Why is that? The reason is that there is an error in the path of the relevant jar package. The solution is not difficult.
Step 6: copy the solr-4.2.0/dist directory and solr-4.2.0/contrib directory under the solr-4.2.0.zip extracted directory to the D:\ xh_solr\ tomcat-solr\ solr\ bin directory. Then configure: d:\ xh_solr\ tomcat-solr\ solr\ collection1\
Conf\ solrconfig.xml file: modify the contents of line 72 and line 82 under the solrconfig.xml file as follows:
At this point, we type http://127.0.0.1:8983/browse, into the browser and we will find that there is no error. But the content displayed has no style. Modify D:\ Tomcat6.0\ conf\ servler.xml as follows:
……
Then type: http://127.0.0.1:8983/solr/browse, and the display will be normal.
But it's still different from what the books say: there is no data. This requires us to import data. Change the directory to the unzipped directory solr-4.2.0\ example\ exampledocs in solr-4.2.0, which on my computer is E:\ OpenSourceForJava\ solr-4.2.0\ example\ exampledocs. Then hold down the shift key, right-click: select the "Open Command window here" option.
Then enter the command in the open command window: java-jar post.jar * .xml. The command is executed correctly as shown in the following figure:
Then the page of the refresh browser is displayed as shown below:
We can type the ipod keyword into it, and the picture will be shown as the first cool picture attached at the beginning of the article. All right, mission accomplished.
That's all for "how to access the browse page of solr4.2". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 213
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.