Skip to content

krishna-prasath-hat/Solr-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Solr-setup

Basic installations :

* apt update
* apt install default-jre
* apt-get install wget
* apt install nano
* apt install sudo
* apt install vim

To Download Solr-8.11.2 and extract :

* wget https://archive.apache.org/dist/lucene/solr/8.11.2/solr-8.11.2.tgz
* tar -xzf solr-8.11.2.tgz

To Download and Zookeeper :

* wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
* tar -xzf zookeeper-3.4.6.tar.gz

After this start solr :

* cd solr-8.11.2
* bin/solr -e cloud -force

Then Execute the following command to enable security :

* bin/solr auth enable -type basicAuth -prompt true -z localhost:9983 -blockUnknown true
            Here it will ask for admin name and password
	

once set go to Solr UI

Pasted Graphic 1

* Then go to “add role” column and create a new role



Here all, collection-admin-read, config-read, core-admin-read needs to be enabled to give the users only the read access


Screenshot 2023-11-28 at 1 34 38 PM

* Once the role is created, verify the permissions tab to confirm whether new role have necessary permissions



Screenshot 2023-11-28 at 1 35 26 PM

* Then go for creating of user



Screenshot 2023-11-28 at 1 35 51 PM

* Then we can login with the role:


Screenshot 2023-11-28 at 1 36 22 PM

Now ACL setup

* cd zookeeper-3.4.6/bin
* ./zkServer.sh start /zookeeper-3.4.6/conf/zoo_sample.cfg   - to start zookeeper
* ./zkServer.sh status /zookeeper-3.4.6/conf/zoo.cfg  - to check status of zookeeper
* ./zkCli.sh -server localhost:2181 - execute this command to get into zookeeper 

inside Zookeeper terminal
        * ls /   - to list 
        * getAcl /   - for listing acl for that directory
        * setAcl / world:anyone:r,ip:172.17.0.2:cdwra    - for setting the ips

Zookeeper - Zoo.cfg file

  • Add folder named with myid file and id of zk should be mentioned like 1 or 2 or 3 (this directory location should be given in dataDir= in the file )

    # The number of milliseconds of each tick
    tickTime=2000
    # The number of ticks that the initial 
    # synchronization phase can take
    initLimit=10
    # The number of ticks that can pass between 
    # sending a request and getting an acknowledgement
    syncLimit=5
    # the directory where the snapshot is stored.
    # do not use /tmp for storage, /tmp here is just 
    # example sakes.
    dataDir=/data
    # the port at which the clients will connect
    clientPort=2181
    4lw.commands.whitelist=mntr,conf,ruok
    
    # the maximum number of client connections.
    # increase this if you need to handle more clients
    #maxClientCnxns=60
    server.1=172.17.0.6:2888:3888
    server.2=172.17.0.4:2889:3889
    server.3=172.17.0.5:2899:3899
    # Be sure to read the maintenance section of the 
    # administrator guide before turning on autopurge.
    #
    # https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
    #
    # The number of snapshots to retain in dataDir
    #autopurge.snapRetainCount=3
    # Purge task interval in hours
    # Set to "0" to disable auto purge feature
    #autopurge.purgeInterval=1
    
    ## Metrics Providers
    #
    # https://prometheus.io Metrics Exporter
    #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
    #metricsProvider.httpHost=0.0.0.0
    #metricsProvider.httpPort=7000
    #metricsProvider.exportJvmInfo=true
    

Zookeeper Commands

  bin/zkServer.sh start
  bin/zkServer.sh status
  bin/zkServer.sh stop

Change in solr



/solr-8.7.0/bin/solr.in.sh - ZK_HOST="172.17.0.6:2181,172.17.0.4:2181,172.17.0.5:2181" (As per the ip address of the zookeeper machines)

  • if not working try killing 2181 with lsof -i:2181 command in zookeeper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors