Skip to content

Commit b08e8d9

Browse files
AndreyBozhkoAndrey Bozhko
andauthored
update tutorial docs (#2366)
Co-authored-by: Andrey Bozhko <[email protected]>
1 parent 49a1bcd commit b08e8d9

File tree

8 files changed

+93
-48
lines changed

8 files changed

+93
-48
lines changed

solr/solr-ref-guide/modules/configuration-guide/pages/configuration-files.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ However, if you are running your own ZooKeeper ensemble, you would supply your o
9191

9292
== Files Screen
9393

94-
The Files screen in the Admin UI lets you browse & view configuration files (such `solrconfig.xml` and the schema file) for the collection you selected.
94+
The Files screen in the Admin UI lets you browse & view configuration files (such as `solrconfig.xml` and the schema file) for the collection you selected.
9595

9696
.The Files Screen
9797
image::configuration-files/files-screen.png[Files screen,height=400]

solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ The `-c` and `-cloud` options are equivalent:
322322

323323
If you specify a ZooKeeper connection string, such as `-z 192.168.1.4:2181`, then Solr will connect to ZooKeeper and join the cluster.
324324

325-
NOTE: If you have defined `ZK_HOST` in `solr.in.sh`/`solr.in.cmd` (see xref:zookeeper-ensemble.adoc#updating-solr-include-files,Updating Solr Include Files>>) you can omit `-z <zk host string>` from all `bin/solr` commands.
325+
NOTE: If you have defined `ZK_HOST` in `solr.in.sh`/`solr.in.cmd` (see xref:zookeeper-ensemble.adoc#updating-solr-include-files[Updating Solr Include Files]) you can omit `-z <zk host string>` from all `bin/solr` commands.
326326

327327
When starting Solr in SolrCloud mode, if you do not define `ZK_HOST` in `solr.in.sh`/`solr.in.cmd` nor specify the `-z` option, then Solr will launch an embedded ZooKeeper server listening on the Solr port + 1000.
328328
For example, if Solr is running on port 8983, then the embedded ZooKeeper will listen on port 9983.

solr/solr-ref-guide/modules/getting-started/pages/introduction.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ Indexes can be sharded and replicated for performance and reliability, using eit
4444
One type of cluster requires no supporting infrastructure, and instances are managed directly by administrators. The second type uses https://zookeeper.apache.org/[Apache Zookeeper^TM^] to coordinate management activities across the cluster.
4545

4646
Solr scaling and high availability features are so effective that some of the largest and most famous internet sites use Solr.
47-
A partial, typically self nominated, list of sites using Solr can be found at https://cwiki.apache.org/confluence/display/solr/PublicServers.
47+
A partial, typically self nominated, list of sites using Solr can be found at https://solr.apache.org/community.html#powered-by.

solr/solr-ref-guide/modules/getting-started/pages/searching-in-solr.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In addition, applications can be configured to allow users to override the defau
3030

3131
To process a search query, a request handler calls a _query parser_, which interprets the terms and parameters of a query.
3232
Different query parsers support different syntax.
33-
Solr's default query parser is known as the xref:query-guide:standard-query-parser.adoc[],or more commonly the "lucene" query parser.
33+
Solr's default query parser is known as the xref:query-guide:standard-query-parser.adoc[], or more commonly, the "lucene" query parser.
3434
Solr also includes the xref:query-guide:dismax-query-parser.adoc[], and the xref:query-guide:edismax-query-parser.adoc[].
3535

3636
The Standard query parser's syntax allows for greater precision in searches, but the DisMax query parser is much more tolerant of errors.

solr/solr-ref-guide/modules/getting-started/pages/solr-tutorial.adoc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@
2020
This tutorial covers getting Solr up and running, ingesting a variety of data sources into Solr collections,
2121
and getting a feel for the Solr administrative and search interfaces.
2222

23-
The tutorial is organized into three sections that each build on the one before it.
23+
The tutorial is organized into a number of sections that each build on the one before it.
24+
2425
The xref:tutorial-techproducts.adoc[first exercise] will ask you to start Solr, create a collection, index some basic documents, and then perform some searches.
2526

2627
The xref:tutorial-films.adoc[second exercise] works with a different set of data, and explores requesting facets with the dataset.
2728

2829
The xref:tutorial-diy.adoc[third exercise] encourages you to begin to work with your own data and start a plan for your implementation.
2930

30-
Finally, we'll introduce <<Spatial Queries,spatial search>> and show you how to get your Solr instance back into a clean state.
31+
The tutorial also includes other, more advanced, exercises that introduce you to xref:tutorial-paramsets.adoc[ParamSets],
32+
xref:tutorial-vectors.adoc[vector search], xref:tutorial-solrcloud.adoc[SolrCloud], and xref:tutorial-aws.adoc[deploying Solr to AWS].
33+
34+
Finally, we'll introduce <<Spatial Queries,spatial search>>, and show you how to get your Solr instance back into a clean state.
3135

3236
== Before You Begin
3337

@@ -43,7 +47,7 @@ For best results, please run the browser showing this tutorial and the Solr serv
4347
== Unpack Solr
4448

4549
Begin by unzipping the full Solr release and changing your working directory to the subdirectory where Solr was installed.
46-
For example, with a shell in UNIX, Cygwin, or MacOS:
50+
For example, with a shell in UNIX, Cygwin, or macOS:
4751

4852
[,console]
4953
----
@@ -57,6 +61,10 @@ $ cd solr-{solr-full-version}/
5761

5862
If you'd like to know more about Solr's directory layout before moving to the first exercise, see the section xref:deployment-guide:installing-solr.adoc#directory-layout[Directory Layout] for details.
5963

64+
== Start with the exercises
65+
66+
Navigate to xref:tutorial-five-minutes.adoc[] to get started. Don't worry, you can come back to this page at a later point,
67+
after you're done with the exercises.
6068

6169
== Spatial Queries
6270

solr/solr-ref-guide/modules/getting-started/pages/tutorial-aws.adoc

Lines changed: 73 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ In this guide we are going to:
2929
* Create new _Security Group_
3030
* Configure instances and launch
3131
. Install, configure and start Solr on newly launched EC2 instances
32-
* Install system prerequisites: Java 1.8 and later
32+
* Install system prerequisites: Java 11 or later
3333
* Download latest version of Solr
3434
* Start the Solr nodes in SolrCloud mode
35-
. Create a collection, index documents and query the system
35+
. Create a collection, index documents, and query the system
3636
* Create collection with multiple shards and replicas
3737
* Index documents to the newly created collection
3838
* Verify documents presence by querying the collection
@@ -129,60 +129,83 @@ $ ssh-add aws-key.pem
129129
$ ssh -A ec2-user@<instance-public-dns>
130130
----
131131
+
132-
. While logged in to each of the AWS EC2 instances, configure Java 1.8 and download Solr:
132+
. While logged in to each of the AWS EC2 instances, configure Java 11 and download Solr:
133133
+
134134
[,console]
135135
----
136-
# verify default java version packaged with AWS instances is 1.7
136+
# check if the AWS instance already has java installed
137137
$ java -version
138-
$ sudo yum install java-1.8.0
138+
139+
# install JDK 11
140+
$ sudo yum install java-11
141+
142+
# configure JDK 11 as the default
139143
$ sudo /usr/sbin/alternatives --config java
140-
# select jdk-1.8
141-
# verify default java version to java-1.8
144+
145+
# verify that the default java version is now 11
142146
$ java -version
143147
----
144148
+
145-
[,console]
149+
[,console,subs="attributes"]
146150
----
147151
# download desired version of Solr
148-
$ wget http://archive.apache.org/dist/solr/solr/{solr-full-version}/solr-{solr-full-version}.tgz
149-
# untar
152+
$ wget https://archive.apache.org/dist/solr/solr/{solr-full-version}/solr-{solr-full-version}.tgz
153+
154+
# untar the archive
150155
$ tar -zxvf solr-{solr-full-version}.tgz
151-
# set SOLR_HOME
156+
157+
# configure SOLR_HOME env variable
152158
$ export SOLR_HOME=$PWD/solr-{solr-full-version}
153-
# put the env variable in .bashrc
154-
# vim ~/.bashrc
159+
160+
# also add the env variable to .bashrc
161+
$ vim ~/.bashrc
155162
export SOLR_HOME=/home/ec2-user/solr-{solr-full-version}
156163
----
157164

158165
. Resolve the Public DNS to simpler hostnames.
159166
+
160-
Let’s assume AWS instances public DNS with IPv4 Public IP are as follows:
161-
+
162-
* ec2-54-1-2-3.us-east-2.compute.amazonaws.com: 54.1.2.3
163-
* ec2-54-4-5-6.us-east-2.compute.amazonaws.com: 54.4.5.6
167+
Let’s assume the public DNS hostnames and IPv4 addresses of EC2 instances are as follows:
168+
169+
* ec2-101-1-2-3.us-east-2.compute.amazonaws.com: 101.1.2.3 (public), 172.16.2.3 (private)
170+
* ec2-101-4-5-6.us-east-2.compute.amazonaws.com: 101.4.5.6 (public), 172.16.5.6 (private)
164171
+
165-
Edit `/etc/hosts`, and add entries for the above machines:
172+
Edit `/etc/hosts` on each of the instances, and add the following entries:
166173
+
167174
[,console]
168175
----
169176
$ sudo vim /etc/hosts
170-
54.1.2.3 solr-node-1
171-
54.4.5.6 solr-node-2
177+
172.16.2.3 solr-node-1
178+
172.16.5.6 solr-node-2
172179
----
173180

174181
. Configure Solr in running EC2 instances.
175182
+
176-
In this case, one of the machines will host ZooKeeper embedded along with Solr node, say, `ec2-101-1-2-3.us-east-2.compute.amazonaws.com` (aka, `solr-node-1`)
183+
In this case, one of the machines will host ZooKeeper embedded along with Solr node, say, `ec2-101-1-2-3.us-east-2.compute.amazonaws.com` (aka, `solr-node-1`).
184+
+
185+
See <<Deploying with External ZooKeeper>> for configuring external ZooKeeper.
186+
+
187+
On both machines, edit the `solr.in.sh` script and configure the environment variables that allow
188+
Solr and embedded ZooKeeper to listen on all network interfaces, and not just on 127.0.0.1
189+
+
190+
[,console]
191+
----
192+
$ cd $SOLR_HOME
193+
194+
# uncomment and edit the two variables
195+
# vim bin/solr.in.sh
196+
SOLR_JETTY_HOST="0.0.0.0"
197+
SOLR_ZK_EMBEDDED_HOST="0.0.0.0"
198+
----
177199
+
178-
See <<Deploying with External ZooKeeper>> for configure external ZooKeeper.
200+
See xref:deployment-guide:securing-solr.adoc#network-configuration[Network Configuration] for more details.
179201
+
180202
Inside the `ec2-101-1-2-3.us-east-2.compute.amazonaws.com` (`solr-node-1`)
181203
+
182204
[,console]
183205
----
184206
$ cd $SOLR_HOME
185-
# start Solr node on 8983 and ZooKeeper will start on 8983+1000 9983
207+
208+
# start Solr node on 8983 and ZooKeeper will start on 9983 (8983+1000)
186209
$ bin/solr start -c -p 8983 -h solr-node-1
187210
----
188211
+
@@ -191,23 +214,24 @@ On the other node, `ec2-101-4-5-6.us-east-2.compute.amazonaws.com` (`solr-node-2
191214
[,console]
192215
----
193216
$ cd $SOLR_HOME
217+
194218
# start Solr node on 8983 and connect to ZooKeeper running on first node
195219
$ bin/solr start -c -p 8983 -h solr-node-2 -z solr-node-1:9983
196220
----
197221

198222
. Inspect and Verify.
199-
Inspect the Solr nodes state from browser on local machine:
200223
+
224+
Inspect the Solr nodes state from browser on local machine.
201225
Go to:
202226
+
203227
[source,bash]
204228
----
205-
http://ec2-101-1-2-3.us-east-2.compute.amazonaws.com:8983/solr (solr-node-1:8983/solr)
229+
http://ec2-101-1-2-3.us-east-2.compute.amazonaws.com:8983/solr
206230
207-
http://ec2-101-4-5-6.us-east-2.compute.amazonaws.com:8983/solr (solr-node-2:8983/solr)
231+
http://ec2-101-4-5-6.us-east-2.compute.amazonaws.com:8983/solr
208232
----
209233
+
210-
You should able to see Solr UI dashboard for both nodes.
234+
You should be able to see Solr UI dashboard for both nodes.
211235

212236
== Create Collection, Index and Query
213237

@@ -223,9 +247,9 @@ If you want to configure an external ZooKeeper ensemble to avoid using the embed
223247
+
224248
[source,text,subs="verbatim"]
225249
$ sudo vim /etc/hosts
226-
54.1.2.3 solr-node-1
227-
54.4.5.6 solr-node-2
228-
54.7.8.9 zookeeper-node
250+
172.16.2.3 solr-node-1
251+
172.16.5.6 solr-node-2
252+
172.16.8.9 zookeeper-node
229253

230254
* You'll need to install ZooKeeper manually, described in the next section.
231255

@@ -239,12 +263,13 @@ See the section xref:deployment-guide:zookeeper-ensemble.adoc[] for information
239263
In this example we're using ZooKeeper v{dep-version-zookeeper}.
240264
On the node you're using to host ZooKeeper (`zookeeper-node`), download the package and untar it:
241265
+
242-
[,console]
266+
[,console,subs="attributes"]
243267
----
244-
# download stable version of ZooKeeper, here {dep-version-zookeeper}
245-
$ wget https://archive.apache.org/dist/zookeeper/zookeeper-{dep-version-zookeeper}/apache-zookeeper-{dep-version-zookeeper}.tar.gz
246-
# untar
247-
$ tar -zxvf apache-zookeeper-{dep-version-zookeeper}.tar.gz
268+
# download stable version of ZooKeeper
269+
$ wget https://archive.apache.org/dist/zookeeper/zookeeper-{dep-version-zookeeper}/apache-zookeeper-{dep-version-zookeeper}-bin.tar.gz
270+
271+
# untar the archive
272+
$ tar -zxvf apache-zookeeper-{dep-version-zookeeper}-bin.tar.gz
248273
----
249274
+
250275
Add an environment variable for ZooKeeper's home directory (`ZOO_HOME`) to the `.bashrc` for the user who will be running the process.
@@ -253,16 +278,18 @@ Correct the path to the ZooKeeper installation as appropriate if where you put i
253278
+
254279
[source,bash,subs="attributes"]
255280
----
256-
$ export ZOO_HOME=$PWD/apache-zookeeper-{dep-version-zookeeper}
281+
$ export ZOO_HOME=$PWD/apache-zookeeper-{dep-version-zookeeper}-bin
282+
257283
# put the env variable in .bashrc
258284
# vim ~/.bashrc
259-
export ZOO_HOME=/home/ec2-user/apache-zookeeper-{dep-version-zookeeper}
285+
export ZOO_HOME=/home/ec2-user/apache-zookeeper-{dep-version-zookeeper}-bin
260286
----
261287
. Change directories to `ZOO_HOME`, and create the ZooKeeper configuration by using the template provided by ZooKeeper.
262288
+
263289
[,console]
264290
----
265291
$ cd $ZOO_HOME
292+
266293
# create ZooKeeper config by using zoo_sample.cfg
267294
$ cp conf/zoo_sample.cfg conf/zoo.cfg
268295
----
@@ -273,17 +300,23 @@ $ cp conf/zoo_sample.cfg conf/zoo.cfg
273300
# create data dir for ZooKeeper, edit zoo.cfg, uncomment autopurge parameters
274301
$ mkdir data
275302
$ vim conf/zoo.cfg
303+
276304
# -- uncomment --
277305
autopurge.snapRetainCount=3
278306
autopurge.purgeInterval=1
307+
279308
# -- edit --
280309
dataDir=data
310+
311+
# -- add --
312+
4lw.commands.whitelist=mntr,conf,ruok
281313
----
282314
. Start ZooKeeper.
283315
+
284316
[,console]
285317
----
286318
$ cd $ZOO_HOME
319+
287320
# start ZooKeeper, default port: 2181
288321
$ bin/zkServer.sh start
289322
----
@@ -293,6 +326,7 @@ $ bin/zkServer.sh start
293326
[,console]
294327
----
295328
$ cd $SOLR_HOME
329+
296330
# start Solr node on 8983 and connect to ZooKeeper running on ZooKeeper node
297331
$ bin/solr start -c -p 8983 -h solr-node-1 -z zookeeper-node:2181
298332
----
@@ -302,8 +336,9 @@ $ bin/solr start -c -p 8983 -h solr-node-1 -z zookeeper-node:2181
302336
[,console]
303337
----
304338
$ cd $SOLR_HOME
339+
305340
# start Solr node on 8983 and connect to ZooKeeper running on ZooKeeper node
306-
$ bin/solr start -c -p 8983 -h solr-node-1 -z zookeeper-node:2181
341+
$ bin/solr start -c -p 8983 -h solr-node-2 -z zookeeper-node:2181
307342
----
308343

309344
[TIP]

solr/solr-ref-guide/modules/getting-started/pages/tutorial-diy.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[[exercise-3]]
2121
== Exercise 3: Index Your Own Data
2222

23-
For this last exercise, work with a dataset of your choice.
23+
For this exercise, work with a dataset of your choice.
2424
This can be files on your local hard drive, a set of data you have worked with before, or maybe a sample of the data you intend to index to Solr for your production application.
2525

2626
This exercise is intended to get you thinking about what you will need to do for your application:
@@ -120,3 +120,5 @@ You can also modify the above to only delete documents that match a specific que
120120
At this point, you're ready to start working on your own.
121121

122122
Jump ahead to the overall xref:solr-tutorial.adoc#wrapping-up[wrap up] when you're ready to stop Solr and remove all the examples you worked with and start fresh.
123+
124+
Or if you'd like, you could work your way through the remaining exercises.

solr/solr-ref-guide/modules/getting-started/pages/tutorial-solrcloud.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ Notice that you need to specify the ZooKeeper address (`-z localhost:9983`) when
190190
=== Adding a Node to a Cluster
191191

192192
Adding a node to an existing cluster is a bit advanced and involves a little more understanding of Solr.
193-
Once you startup a SolrCloud cluster using the startup scripts, you can add a new node to it by:
193+
Once you start a SolrCloud cluster using the startup scripts, you can add a new node to it by:
194194

195195
[,console]
196196
----
197197
$ mkdir <solr.home for new Solr node>
198-
$ bin/solr start -cloud -s solr.home/solr -p <port num> -z <zk hosts string>
198+
$ bin/solr start -cloud -s <solr.home>/solr -p <port num> -z <zk hosts string>
199199
----
200200

201201
Notice that the above requires you to create a Solr home directory.

0 commit comments

Comments
 (0)