solr(version : stable 6.6.0)
安装solr
命令行输入:brew install solr
安装zookeeper
命令行输入:brew install zookeeper
命令行输入:
➜ ~ solr -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]:
3
Ok, let's start up 3 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983]:
8983
Please enter the port for node2 [7574]:
7574
Please enter the port for node3 [8984]:
8984
Solr home directory /usr/local/Cellar/solr/6.1.0/example/cloud/node1/solr already exists.
/usr/local/Cellar/solr/6.1.0/example/cloud/node2 already exists.
Cloning /usr/local/Cellar/solr/6.1.0/example/cloud/node1 into
/usr/local/Cellar/solr/6.1.0/example/cloud/node3
Starting up Solr on port 8983 using command:
/usr/local/Cellar/solr/6.1.0/bin/solr start -cloud -p 8983 -s "/usr/local/Cellar/solr/6.1.0/example/cloud/node1/solr"
Waiting up to 30 seconds to see Solr running on port 8983 [|]
Started Solr server on port 8983 (pid=23511). Happy searching!
Starting up Solr on port 7574 using command:
/usr/local/Cellar/solr/6.1.0/bin/solr start -cloud -p 7574 -s "/usr/local/Cellar/solr/6.1.0/example/cloud/node2/solr" -z localhost:9983
Waiting up to 30 seconds to see Solr running on port 7574 [|]
Started Solr server on port 7574 (pid=23609). Happy searching!
Starting up Solr on port 8984 using command:
/usr/local/Cellar/solr/6.1.0/bin/solr start -cloud -p 8984 -s "/usr/local/Cellar/solr/6.1.0/example/cloud/node3/solr" -z localhost:9983
Waiting up to 30 seconds to see Solr running on port 8984 [|]
Started Solr server on port 8984 (pid=23702). Happy searching!
INFO - 2017-07-18 18:15:56.218; org.apache.solr.client.solrj.impl.CloudSolrClient; Final constructed zkHost string: localhost:9983
Now let's create a new collection for indexing documents in your 3-node cluster.
Please provide a name for your new collection: [gettingstarted]
solr-test
How many shards would you like to split solr-test into? [2]
2
How many replicas per shard would you like to create? [2]
2
Please choose a configuration for the solr-test collection, available options are:
basic_configs, data_driven_schema_configs, or sample_techproducts_configs [data_driven_schema_configs]
data_driveen_schema_configs
data_driveen_schema_configs is not a valid configuration directory! Please choose a configuration for the solr-test collection, available options are:
basic_configs, data_driven_schema_configs, or sample_techproducts_configs [data_driven_schema_configs]
data_driven_schema_configs
INFO - 2017-07-18 18:18:21.948; org.apache.solr.client.solrj.impl.CloudSolrClient; Final constructed zkHost string: localhost:9983
Connecting to ZooKeeper at localhost:9983 ...
Uploading /usr/local/Cellar/solr/6.1.0/server/solr/configsets/data_driven_schema_configs/conf for config solr-test to ZooKeeper at localhost:9983
Creating new collection 'solr-test' using command:
http://localhost:8983/solr/admin/collections?action=CREATE&name=solr-test&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=solr-test
{
"responseHeader":{
"status":0,
"QTime":11839},
"success":{
"10.4.94.128:8983_solr":{
"responseHeader":{
"status":0,
"QTime":2318},
"core":"solr-test_shard1_replica1"},
"10.4.94.128:7574_solr":{
"responseHeader":{
"status":0,
"QTime":2652},
"core":"solr-test_shard2_replica1"},
"10.4.94.128:8984_solr":{
"responseHeader":{
"status":0,
"QTime":2677},
"core":"solr-test_shard1_replica2"}}}
Enabling auto soft-commits with maxTime 3 secs using the Config API
POSTing request to Config API: http://localhost:8983/solr/solr-test/config
{"set-property":{"updateHandler.autoSoftCommit.maxTime":"3000"}}
Successfully set-property updateHandler.autoSoftCommit.maxTime to 3000
SolrCloud example running, please visit: http://localhost:8983/solr
➜ ~
网友评论