Solr基础操作1

2022-06-29 22:31:28 浏览数 (1)

安装

下载与解压

Solr下载地址

Tip: 里面列举了很多地址,可以选取一个离自己最近的最快的站点下载

root@h102 solr# tar -zxvf solr-5.3.0.tgz

solr-5.3.0/LUCENE_CHANGES.txt

solr-5.3.0/contrib/analysis-extras/lib/

solr-5.3.0/contrib/clustering/lib/

solr-5.3.0/contrib/dataimporthandler-extras/lib/

...

...

solr-5.3.0/docs/solr-velocity/resources/titlebar.gif

solr-5.3.0/docs/solr-velocity/resources/titlebar_end.gif

solr-5.3.0/docs/solr-velocity/stylesheet.css

root@h102 solr# ls

solr-5.3.0 solr-5.3.0.tgz

root@h102 solr# cd solr-5.3.0

root@h102 solr-5.3.0# ls

bin CHANGES.txt contrib dist docs example licenses LICENSE.txt LUCENE_CHANGES.txt NOTICE.txt README.txt server

root@h102 solr-5.3.0#

启动solr

root@h102 solr-5.3.0# bin/solr start -e cloud -noprompt

Welcome to the SolrCloud example!

Starting up 2 Solr nodes for your example SolrCloud cluster.

Creating Solr home directory /data/solr/solr-5.3.0/example/cloud/node1/solr

Cloning /data/solr/solr-5.3.0/example/cloud/node1 into

/data/solr/solr-5.3.0/example/cloud/node2

Starting up Solr on port 8983 using command:

bin/solr start -cloud -p 8983 -s "example/cloud/node1/solr"

Waiting up to 30 seconds to see Solr running on port 8983 []

Started Solr server on port 8983 (pid=3579). Happy searching!

Starting up Solr on port 7574 using command:

bin/solr start -cloud -p 7574 -s "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=3799). Happy searching!

Connecting to ZooKeeper at localhost:9983 ...

Uploading /data/solr/solr-5.3.0/server/solr/configsets/data_driven_schema_configs/conf for config gettingstarted to ZooKeeper at localhost:9983

Creating new collection 'gettingstarted' using command:

http://localhost:8983/solr/admin/collections?action=CREATE&name=gettingstarted&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=gettingstarted

{

"responseHeader":{

代码语言:txt复制
"status":0,
代码语言:txt复制
"QTime":20494},

"success":{"":{

代码语言:txt复制
  "responseHeader":{
代码语言:txt复制
    "status":0,
代码语言:txt复制
    "QTime":19880},
代码语言:txt复制
  "core":"gettingstarted_shard1_replica2"}}}

Enabling auto soft-commits with maxTime 3 secs using the Config API

POSTing request to Config API: http://localhost:8983/solr/gettingstarted/config

{"set-property":{"updateHandler.autoSoftCommit.maxTime":"3000"}}

Successfully set-property updateHandler.autoSoftCommit.maxTime to 3000

SolrCloud example running, please visit: http://localhost:8983/solr

root@h102 solr-5.3.0#

0 人点赞