Victoria,

On 4/26/22 00:15, Victoria Stuart (VictoriasJourney.com) wrote:

With a standalone Solr 8.11.1 instance with SSL enabled on an Arch Linux system,

[victoria@victoria solr-8.11.1]$ solr status

   Found 1 Solr nodes:

   Solr process 3380449 running on port 8983
   INFO  - 2022-04-25 20:55:03.283; 
org.apache.solr.util.configuration.SSLConfigurations; Setting 
javax.net.ssl.keyStorePassword
   INFO  - 2022-04-25 20:55:03.286; 
org.apache.solr.util.configuration.SSLConfigurations; Setting 
javax.net.ssl.trustStorePassword
   {
     "solr_home":"/mnt/Vancouver/apps/solr/solr-8.11.1/server/solr",
     "version":"8.11.1 0b002b11819df70783e83ef36b42ed1223c14b50 - janhoy - 
2021-12-14 13:50:55",
     "startTime":"2022-04-26T03:52:16.715Z",
     "uptime":"0 days, 0 hours, 2 minutes, 47 seconds",
     "memory":"89.3 MB (%4.4) of 2 GB"}

[victoria@victoria solr-8.11.1]$

... how can I post documents on the command line?

Do I need to provide my Solr admin username:password ( -u user;pass)?

Here I show the output without a username:password, but I got the identical
output using it.

[victoria@victoria solr-8.11.1]$ post -c pg-solr 
/mnt/Vancouver/apps/solr/solr-8.11.1/server/solr/virginia_lamp_thomas.html

/usr/lib/jvm/java-18-openjdk//bin/java -classpath 
/mnt/Vancouver/apps/solr/solr-8.11.1/dist/solr-core-8.11.1.jar -Dauto=yes 
-Dc=pg-solr -Ddata=files org.apache.solr.util.SimplePostTool 
/mnt/Vancouver/apps/solr/solr-8.11.1/server/solr/virginia_lamp_thomas.html
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/pg-solr/update...
Entering auto mode. File endings considered are 
xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
POSTing file virginia_lamp_thomas.html (text/html) to [base]/extract
SimplePostTool: FATAL: IOException while posting data: java.io.IOException: 
Error writing request body to server

You are using client TLS certificates, right?

It looks like the tool itself doesn't have direct CLI support for it, you have to add your own system properties from the CLI:

https://solr.apache.org/guide/8_8/enabling-ssl.html#index-documents-using-post-jar

e.g.

$ java -Djavax.net.ssl.keyStorePassword=secret -Djavax.net.ssl.keyStore=../../server/etc/solr-ssl.keystore.p12 -Djavax.net.ssl.trustStore=../../server/etc/solr-ssl.keystore.p12 -Djavax.net.ssl.trustStorePassword=secret -Durl=https://localhost:8984/solr/mycollection/update -jar post.jar *.xml

Note that the "key store" here must point to your *client keystore* containing your client key + cert and the trust store must point to a file containing your server's certificate (and, optionally, key).

You can also use curl which may be more convenient than building-up the whole Java command-line like that.

If you aren't using client certs, you will probably still need to specify the trust store on the CLI unless you have a server cert signed by a real CA. (Most Solrs I've seen just use self-signed certs becasue there really isn't a reason to have the signed by a real CA.)

-chris

Reply via email to