Hướng dẫn cài đặt apache solr 5.0.0 trên windows

Bitnami Apache Solr Stack là một dự án phần mềm đa nền tảng được phân phối tự do, đơn giản hóa việc cài đặt và lưu trữ ứng dụng Apache Solr, cũng như tất cả các phụ thuộc thời gian chạy của nó, trên máy tính để bàn và máy tính xách tay được cung cấp bởi bản phân phối GNU / Linux hoặc hệ điều hành Microsoft Windows và Mac OS X.

Apache Solr là gì?

Apache Solr là một máy chủ tìm kiếm mã nguồn mở, độc lập với nền tảng, miễn phí và hiệu suất cao dựa trên dự án Apache Lucene, sử dụng các API JSON và XML / HTTP. Điểm nổi bật bao gồm tích hợp cơ sở dữ liệu, tìm kiếm không gian địa lý, tìm kiếm toàn văn bản, phân cụm động, tìm kiếm mặt, đánh dấu nhấn và xử lý tài liệu phong phú.

Cài đặt Bitnami Apache Solr Stack

Sản phẩm Bithri Apache Solr Stack có thể được triển khai bằng cách sử dụng trình cài đặt gốc, thiết bị ảo, vùng chứa Docker hoặc ảnh trên đám mây. Trình cài đặt gốc được xây dựng bằng cách sử dụng công cụ cài đặt đa nền tảng của BitRock và hỗ trợ cả kiến ​​trúc 32 bit và 64 bit.

Để cài đặt ứng dụng Apache Solr trên máy tính cá nhân của bạn, trước tiên bạn sẽ phải tải xuống tệp nhị phân tương ứng với kiến ​​trúc phần cứng của máy tính, chạy nó và làm theo hướng dẫn được hiển thị trên màn hình.

Lưu trữ Apache Solr trên đám mây

Ngoài việc cài đặt Apache Solr trên máy tính cá nhân của bạn, bạn cũng có thể lưu trữ nó trên đám mây, nhờ vào hình ảnh đám mây được tạo sẵn của Bitnami cho các dịch vụ lưu trữ đám mây của Amazon EC2 và Windows Azure.

Ảo hóa Apache Solr trên VirtualBox và VMware

Người dùng cũng có thể ảo hóa ứng dụng Apache Solr trên Oracle VirtualBox và VMware ESX, phần mềm ảo hóa ESXi, vì Bitnami cung cấp một thiết bị ảo dựa trên bản phát hành ổn định mới nhất của bản phân phối Ubuntu Linux.

Vùng chứa Bitnami Apache Solr Docker

Trong khi Bitnami không cung cấp cho người dùng các mô-đun LAMP, WAMP và MAMP cho ứng dụng Apache Solr, nó sẽ cung cấp một vùng chứa Docker giúp bạn ảo hóa Apache Solr trên các thùng chứa Linux.

Checking your browser before accessing q3hcvxnr43.xn--80ae1ambq.xn--p1ai.

This process is automatic. Your browser will redirect to your requested content shortly.

Please allow up to 3 seconds...

Bad Bot protection by AntiBot.Cloud

Your IP: 168.138.10.127

How would one run the "bin/solr.cmd start" script so that it runs in the background in windows? Formerly, you could either run on tomcat and effectively run as a windows service. Alternatively, you could run the start.jar directly with "nohup" to prevent the hangup when the command prompt is closed.

With the release of Solr 5.0, it appears that Solr is now a standalone Java application that must be started with the start script (not a direct jar file).

Currently, if the command prompt that initiated the start command on Windows is closed, the application stops.

In this tutorial, I will show you how to run Solr as a Microsoft Windows service. Up to version 5.0.0, it was possible to run Solr inside the Java web application container of your choice. However, since the release of version 5.0.0, the Solr team at Apache no longer releases the solr.war file. This file was necessary to run Solr from a different web application container such as Tomcat. Starting with version 5.0.0, Solr will be distributed only as a self-contained web application, using an embedded version of Jetty as a container.

Unfortunately, Jetty does not have a nice utility like Tomcat’s to register itself as a service on Microsoft Windows. I had to research and experiment to come up with a clean and easily-reproduced solution. I tried to follow the Jetty website instructions and adapt them to make Jetty work with Solr, but I was not able to stop the service cleanly. When I would request a “stop” from the Windows Service Manager, the service was flip-flopping between “starting” and “stopping” statuses. Then I discovered a simple tool, NSSM, that did exactly what I wanted. I will be using the NSSM tool in this tutorial.

Applications to Download

  • Apache Solr
  • NSSM
  • Java (version 7 minimum for Solr 5.x, and version 8 minimum for Solr 6.x)

File System Setup

Taking Solr 5.0.0 as an example, first, extract Solr and NSSM to the following path on your file system (adapt paths as necessary).

C:\Program Files\solr-5.0.0 C:\Program Files\nssm

Setting up Solr as a service

On the command line, type the following:

"c:\Program Files\nssm\win64\nssm" install solr5

Fill out the path to the solr.cmd script, and the startup directory should be filled in automatically. Don’t forget to input the -f (foreground) parameter so that NSSM can kill it when it needs to be stopped or restarted.

Hướng dẫn cài đặt apache solr 5.0.0 trên windows

The following step is optional, but I prefer having a clean and descriptive name in my Windows Service Manager. Under the details tab, fill out the Display name and Description.

Hướng dẫn cài đặt apache solr 5.0.0 trên windows

Click on Install service.

Hướng dẫn cài đặt apache solr 5.0.0 trên windows

Check that the service is running.

Hướng dẫn cài đặt apache solr 5.0.0 trên windows

Go to your favorite web browser and make sure Solr is up and running.

Hướng dẫn cài đặt apache solr 5.0.0 trên windows

Conclusion

I spent a few hours finding this simple solution, and I hope this tutorial will help you set up Solr as a Microsoft Windows service in no time. I invite you to view the solr.cmd file content to find the parameters that will help you customize your Solr setup. For instance, while looking inside this file, I realized there I needed to add the -f parameter to run Solr in the foreground. That was key to get it running the way I needed it.

If you successfully used a different approach to register Solr 5 as a service, please share it in the comments section below.