You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Support Rocky Linux
* Upgrade notes.
* Print warning if init.d script exists
* Review comment: restart on failure
Also add RestartSec, StartLimitIntervalSec and StartLimitBurst
Co-authored-by: Jan Høydahl <[email protected]>
echo" The first argument to the script must be a path to a Solr distribution archive, such as solr-5.0.0.tgz"
32
+
echo" The first argument to the script must be a path to a Solr distribution archive, such as solr-10.0.0.tgz"
33
33
echo" (only .tgz is supported format for the archive)"
34
34
echo""
35
35
echo" Supported OPTIONS include:"
@@ -73,6 +73,8 @@ for command in "grep -E \"^NAME=\" /etc/os-release" \
73
73
distro=RedHat
74
74
elif [[ ${distro_string,,}==*"centos"* ]];then
75
75
distro=CentOS
76
+
elif [[ ${distro_string,,}==*"rocky"* ]];then
77
+
distro=CentOS
76
78
elif [[ ${distro_string,,}==*"ubuntu"* ]];then
77
79
distro=Ubuntu
78
80
elif [[ ${distro_string,,}==*"suse"* ]];then
@@ -100,6 +102,10 @@ if [ ! -f "$SOLR_ARCHIVE" ]; then
100
102
exit 1
101
103
fi
102
104
105
+
if [ -f"/etc/init.d/${SOLR_SERVICE}" ];then
106
+
echo"WARNING: Found pre-existing /etc/init.d/${SOLR_SERVICE}, please remove!"
107
+
fi
108
+
103
109
# strip off path info
104
110
SOLR_INSTALL_FILE=${SOLR_ARCHIVE##*/}
105
111
if [ ${SOLR_INSTALL_FILE: -4}==".tgz" ];then
@@ -185,8 +191,8 @@ fi
185
191
# Test for availability of needed tools
186
192
tar --version &>/dev/null || print_error "Script requires the 'tar' command"
187
193
if [[ $SOLR_START=="true" ]] ;then
188
-
service --version &>/dev/null ||service --help &>/dev/null ||print_error "Script requires the 'service' command"
189
-
java -version &>/dev/null || print_error "Solr requires java, please install or set JAVA_HOME properly"
194
+
systemctl --version &>/dev/null || print_error "Script requires the 'systemctl' command"
195
+
java -version &>/dev/null || print_error "Solr requires java, please install or set JAVA_HOME properly"
190
196
fi
191
197
lsof -h &>/dev/null ||echo"We recommend installing the 'lsof' command for more stable start/stop of Solr"
192
198
@@ -221,21 +227,21 @@ if [ -z "$SOLR_UPGRADE" ]; then
221
227
fi
222
228
223
229
if [ !"$SOLR_UPGRADE"="YES" ];then
224
-
if [ -f"/etc/init.d/$SOLR_SERVICE" ];then
225
-
print_usage "/etc/init.d/$SOLR_SERVICE already exists! Perhaps Solr is already setup as a service on this host? To upgrade Solr use the -f option."
230
+
if [ -f"/etc/systemd/system/$SOLR_SERVICE.service" ];then
231
+
print_usage "/etc/systemd/system/$SOLR_SERVICE.service already exists! Perhaps Solr is already setup as a service on this host? To upgrade Solr use the -f option."
226
232
exit 1
227
233
fi
228
234
229
-
if [ -e"$SOLR_EXTRACT_DIR/$SOLR_SERVICE" ];then
230
-
print_usage "$SOLR_EXTRACT_DIR/$SOLR_SERVICE already exists! Please move this directory / link or choose a different service name using the -s option."
235
+
if [ -e"$SOLR_EXTRACT_DIR/$SOLR_SERVICE.service" ];then
236
+
print_usage "$SOLR_EXTRACT_DIR/$SOLR_SERVICE.service already exists! Please move this directory / link or choose a different service name using the -s option."
231
237
exit 1
232
238
fi
233
239
fi
234
240
235
241
# stop running instance
236
-
if [ -f"/etc/init.d/$SOLR_SERVICE" ];then
242
+
if [ -f"/etc/systemd/system/$SOLR_SERVICE.service" ];then
237
243
echo -e "\nStopping Solr instance if exists ...\n"
Copy file name to clipboardExpand all lines: solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc
+23-32Lines changed: 23 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,13 +152,9 @@ SOLR_LOGS_DIR=/var/solr/logs
152
152
153
153
For more information about Log4J configuration, please see: xref:configuring-logging.adoc[].
154
154
155
-
==== init.d Script
155
+
==== systemd Service
156
156
157
-
When running a service like Solr on Linux, it’s common to setup an init.d script so that system administrators can control Solr using the service tool, such as: `service solr start`.
158
-
The installation script creates a very basic init.d script to help you get started.
159
-
Take a moment to inspect the `/etc/init.d/solr` file, which is the default script name setup by the installation script.
160
-
If you used the `-s` option on the install script to change the name of the service, then the filename will be different.
161
-
Notice that the following variables are setup for your environment based on the parameters passed to the installation script:
157
+
The installation script creates a very basic systemd service to help you get started. Take a moment to inspect the `/etc/systemd/system/solr.service` file, which is the default service file setup by the installation script. If you used the `-s` option on the install script to change the name of the service, then the filename will be different. Notice that the following variables are setup for your environment based on the parameters passed to the installation script:
The `SOLR_INSTALL_DIR` and `SOLR_ENV` variables should be self-explanatory.
171
-
The `RUNAS` variable sets the owner of the Solr process, such as `solr`; if you don’t set this value, the script will run Solr as **root**, which is not recommended for production.
172
-
You can use the `/etc/init.d/solr` script to start Solr by doing the following as root:
166
+
The `SOLR_INSTALL_DIR` and `SOLR_ENV` variables should be self-explanatory. The `RUNAS` variable sets the owner of the Solr process, such as `solr`; if you don’t set this value, the script will run Solr as **root**, which is not recommended for production. You can start Solr by doing the following as root:
173
167
174
168
[source,bash]
175
169
----
176
-
service solr start
170
+
systemctl start solr
177
171
----
178
172
179
-
The `/etc/init.d/solr` script also supports the **stop**, **restart**, and *status* commands.
180
-
Please keep in mind that the init script that ships with Solr is very basic and is intended to show you how to setup Solr as a service.
181
-
However, it’s also common to use more advanced tools like *supervisord* or *upstart* to control Solr as a service on Linux.
182
-
While showing how to integrate Solr with tools like supervisord is beyond the scope of this guide, the `init.d/solr` script should provide enough guidance to help you get started.
183
173
Also, the installation script sets the Solr service to start automatically when the host machine initializes.
184
174
185
175
=== Progress Check
186
176
187
-
In the next section, we cover some additional environment settings to help you fine-tune your production setup.
188
-
However, before we move on, let's review what we've achieved thus far.
189
-
Specifically, you should be able to control Solr using `/etc/init.d/solr`.
190
-
Please verify the following commands work with your setup:
177
+
In the next section, we cover some additional environment settings to help you fine-tune your production setup. However, before we move on, let's review what we've achieved thus far. Specifically, you should be able to control Solr using `systemctl`. Please verify the following commands work with your setup:
191
178
192
179
[source,bash]
193
180
----
194
-
sudo service solr restart
195
-
sudo service solr status
181
+
sudo systemctl restart solr
182
+
sudo systemctl status solr
196
183
----
197
184
198
185
The status command should give some basic information about the running Solr node that looks similar to:
Apr 16 20:42:01 localhost.localdomain systemd[1]: Started Apache Solr.
208
202
----
209
203
210
204
If the `status` command is not successful, look for error messages in `/var/solr/logs/solr.log`.
@@ -469,10 +463,7 @@ Below 32GB, Java is able to use compressed pointers, but above that point, large
469
463
If your use case needs over 31GB of heap, then consider multiple nodes since they typically will perform better than one node with >32GB of heap.
470
464
====
471
465
472
-
If your use case requires multiple instances, at a minimum you will need unique Solr home directories for each node you want to run; ideally, each home should be on a different physical disk so that multiple Solr nodes don’t have to compete with each other when accessing files on disk.
473
-
Having different Solr home directories implies that you’ll need a different include file for each node.
474
-
Moreover, if using the `/etc/init.d/solr` script to control Solr as a service, then you’ll need a separate script for each node.
475
-
The easiest approach is to use the service installation script to add multiple services on the same host, such as:
466
+
If your use case requires multiple instances, at a minimum you will need unique Solr home directories for each node you want to run; ideally, each home should be on a different physical disk so that multiple Solr nodes don’t have to compete with each other when accessing files on disk. Having different Solr home directories implies that you’ll need a different include file for each node. Moreover, if using `systemctl` to control Solr, then you’ll need a separate service for each node. The easiest approach is to use the service installation script to add multiple services on the same host, such as:
476
467
477
468
[source,bash,subs="attributes"]
478
469
----
@@ -484,6 +475,6 @@ After installing the solr2 service, verify it works correctly by doing:
Copy file name to clipboardExpand all lines: solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,10 @@ Before starting an upgrade to this version of Solr, please take the time to revi
33
33
* `SolrClient` implementations that rely on "base URL" strings now only accept "root" URL paths (i.e. URLs that end in "/solr").
34
34
Users who previously relied on collection-specific URLs to avoid including the collection name with each request can instead achieve this by specifying a "default collection" using the `withDefaultCollection` method available on most `SolrClient` Builders.
35
35
36
+
=== Service installer
37
+
38
+
The service installer now installs a `systemd` startup script instead of an `init.d` startup script. It is up to the user to uninstall any existing `init.d` script when upgrading.
39
+
36
40
=== Deprecation removals
37
41
38
42
* The `jaegertracer-configurator` module, which was deprecated in 9.2, is removed. Users should migrate to the `opentelemetry` module.
0 commit comments