I have installed zookeeper on 3 machines. And set zoo.conf file. It's running with configuration. I installed solr also on these 3 machine.
Now i need to know how to run solr cloud on group of machine with number of shards?
My zookeeper configuration on all machine :-
tickTime=2000
dataDir=/var/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
server.1=instance-1:2888:3888
server.2=instance-2:2889:3889
server.3=instance-3:2890:3890
zookeeper command to run it on all machine:-
bin/zkServer.sh start conf/zoo.cfg
Solr command to run it:-
bin/solr start -e cloud -z instance-1:2181,instance-2:2182,instance-3:2183 -noprompt
It's just creating 2 shards on each machine individually on default port. Not able to connect machine with each other.
Related
So, I have two instance of solr node running along with a embedded zookeeper on a single machine using the link Set up solrCloud. Now I want to add a new machine to this cluster. I run bin\solr start -cloud -s ./solr -h newMachineIP -p 9000 -z oldMachineIP:9983. It shows successful startup, but when I create a new collection it gives me an error saying "Server refused connection at: http://newMachineIp:9000/solr"
just a guess but... does C:\path\to\dir\solr-7.1.0\solr-7.1.0\server\solr\gettingstarted contain any spaces? If so, install Solr into a path with no spaces, this has been an issue before in Windows, and it's possible it still is in some code paths. Solr on Windows get much less testing than on linux.
How to upgrade Apache solr from existing version 4.10.4 to 6.6.0 (A latest one)
On linux centos 7 operating system.
stop existing running solr
sudo service solr stop
confirm its stopped or not
sudo service solr status
You can take backup of existing solr data from
/var/solr/data/< core_name >, But reindexing solr data after upgrading
solr version will give best performance without any unknown issues.
now remove existing solr from centos
sudo rm -r /var/solr
remove solr from following location if its there
sudo rm -r /opt/solr
sudo rm /etc/init.d/solr
In my case following path was not exist to delete, Delete if exists in your case
sudo rm -r /opt/solr/solr-4.10.4
remove existing solr user with home directory
sudo userdel -r solr
for ubuntu
sudo deluser --remove-home solr
remove existing group
sudo groupdel solr
for ubuntu
sudo deluser --group solr
restart your system
sudo reboot
Check supporting application and download solr 6.6
Check which version Java version is installed on your machine
java -version
Check available java versions, and update to latest version
yum list available java*
Install latest java version
sudo yum install <jdk version>
download and extract installation folder
mkdir /home/user/temp
cd temp
wget http://apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz
tar -zxvf solr-6.6.0.tgz
install solr
cd solr-6.6.0/
sudo bin/install_solr_service.sh /home/user/temp/solr-6.6.0.tgz
after successful installation you can see following output
id: solr: no such user Creating new user: solr
Extracting /home/user/temp/solr-6.6.0.tgz to /opt
Installing symlink /opt/solr -> /opt/solr-6.6.0 ...
Installing /etc/init.d/solr script ...
Installing /etc/default/solr.in.sh ...
Service solr installed. Customize Solr startup configuration in
/etc/default/solr.in.sh Waiting up to 180 seconds to see Solr running
on port 8983 [] Started Solr server on port 8983 (pid=4802). Happy
searching!
Found 1 Solr nodes:
Solr process 4802 running on port 8983 {
"solr_home":"/var/solr/data", "version":"6.6.0
5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30
07:32:53", "startTime":"2017-06-26T07:02:51.523Z", "uptime":"0
days, 0 hours, 0 minutes, 13 seconds", "memory":"34.4 MB (%7) of
490.7 MB"}
Now check if you can access solr admin panel
http://localhost:8983/solr/
Check if solr is running, start solr if not running and then try
sudo service solr status
If you are still not able to access solr admin panel, then may you OS firewall is blocking to port 8983
use following commands to allow port 8983 in firewall
sudo firewall-cmd --zone = public --add-port = 8983 / tcp --permanent
sudo firewall-cmd --reload
For further data migration please see Migration of solr cores after solr version upgradation from 4.10.4 to 6.6.0 on Cent os 7
When I running command bin/solr start -e cloud it is not asking me to collection name and other information like no of replicas and configuration settings.
I got following output
Welcome to the SolrCloud example!
This interactive session will help you launch a SolrCloud cluster on your local workstation.
To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2] 2
Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983]
8983
Please enter the port for node2 [7574]
7574
Creating Solr home directory /home/webuser/abhijeet/solr-5.0.0/example/cloud/node1/solr
Cloning Solr home directory /home/webuser/abhijeet/solr-5.0.0/example/cloud/node1 into /home/webuser/abhijeet/solr-5.0.0/example/cloud/node2
Starting up SolrCloud node1 on port 8983 using command:
solr start -cloud -s example/cloud/node1/solr -p 8983
Started Solr server on port 8983 (pid=23735). Happy searching!
I tried it ...here it goes...only difference is I tried on Ubantu
abhijit#abhijit:~/Downloads/solr-5.0.0$ bin/solr start -e cloud
Welcome to the SolrCloud example!
This interactive session will help you launch a SolrCloud cluster on your local workstation.
To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2] 2
Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983] 8983
Oops! Looks like port 8983 is already being used by another process. Please choose a different port. 8985
8985
Please enter the port for node2 [7574] 7576
7576
Starting up SolrCloud node1 on port 8985 using command:
solr start -cloud -s example/cloud/node1/solr -p 8985
Waiting to see Solr listening on port 8985 [|]
Started Solr server on port 8985 (pid=7092). Happy searching!
Starting node2 on port 7576 using command:
solr start -cloud -s example/cloud/node2/solr -p 7576 -z localhost:9985
Waiting to see Solr listening on port 7576 [\]
Started Solr server on port 7576 (pid=7461). Happy searching!
Now let's create a new collection for indexing documents in your 2-node cluster.
Please provide a name for your new collection: [gettingstarted] testCore
testCore
How many shards would you like to split testCore into? [2] 2
2
How many replicas per shard would you like to create? [2] 2
2
Please choose a configuration for the testCore collection, available options are:
basic_configs, data_driven_schema_configs, or sample_techproducts_configs [data_driven_schema_configs] data_driven_schema_configs
Connecting to ZooKeeper at localhost:9985
Uploading /home/abhijit/Downloads/solr-5.0.0/server/solr/configsets/data_driven_schema_configs/conf for config testCore to ZooKeeper at localhost:9985
Creating new collection 'testCore' using command:
http://127.0.1.1:7576/solr/admin/collections?action=CREATE&name=testCore&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=testCore
{
"responseHeader":{
"status":0,
"QTime":7468},
"success":{"":{
"responseHeader":{
"status":0,
"QTime":7057},
"core":"testCore_shard1_replica2"}}}
SolrCloud example running, please visit http://localhost:8985/solr
I've got a test zookeeper configuration up and running and can use the zkcli command to create a running cluster (in this case managing solr).
Is there anyway to do this by passing a configuration file to zookeeper rather than piping commands through zkcli?
I have 3 Zookeeper servers running at server1:2181, server2:2181 and server3:2181.
I want to start 4 Solr servers at server1:8983,server2:8983,server3:8983 and server4:8983 to point to Zookeeper Ensemble above. So at server1, I run a command:
bin>solr -c -z server1:2181,server2:2181,server3:2181 -m 2g
and I received an error message:
Missing operand.
Invalid command-line option: server2:2181
Usage:.........
but if I point to one Zookeeper server such as:
bin>solr -c -z server1:2181 -m 2g
it starts successfully.
All server running in Windows.
What did I do wrong? Or does the Solr start script in Windows have an error?
You need to put your zk connection string in quotes.