User Tools

Site Tools


solr

This is an old revision of the document!


Apache Solr Server

Install Solr

https://tecadmin.net/install-apache-solr-on-ubuntu/

Create User and set password

curl --user USERNAME http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"set-user": {"tom" : "TomIsCool","harry":"HarrysSecret"}}'

Delete User

curl --user USERNAME http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json'-d  '{
 "delete-user": ["tom","harry"]}'

Create Core

sudo su - solr -c "/opt/solr/bin/solr create -c mycol1 -n data_driven_schema_configs"

Basic Auth

Create file /var/solr/data/security.json and add the following content:

{
  "authentication":{
    "blockUnknown":true,
    "class":"solr.BasicAuthPlugin",
    "credentials":{"solr":"DAM_SECRET_HASH_THING"},
    "":{"v":0}},
  "authorization":{
    "class":"solr.RuleBasedAuthorizationPlugin",
    "permissions":[{
        "name":"security-edit",
        "role":"admin"}],
    "user-role":{"solr":"admin"}}}
This is required to run /opt/solr/bin/solr-Command when BasicAuthPlugin is enabled

In /etc/default/solr.in.sh set the Following:

SOLR_AUTH_TYPE="basic"
SOLR_AUTHENTICATION_OPTS="-Dbasicauth=MY_SOLR_USER:MY_PASSWORD"
solr.1518603801.txt.gz · Last modified: 2018/02/14 11:23 by admin