cloudera solrcloud搭建

clouderaCDH中添加solr服務(wù)(三個(gè)節(jié)點(diǎn)):

設(shè)置好本地solr_HOME和HDFS_HOME,連接zookeeper服務(wù)

安裝完成之后就可以通過(guò)http://IP:8983/solr頁(yè)面管理solr服務(wù)

創(chuàng)建Collection

1.生產(chǎn)實(shí)體配置文件:

solrctl?instancedir?--generate /var/lib/solr/collectionName #其中/var/lib/solr 為自己設(shè)置的一個(gè)放置生成實(shí)體配置文件的目錄;collectionName 為生成的這個(gè)配置的目錄名稱(chēng)

collectionName 為生成的這個(gè)配置的目錄名稱(chēng)生成配置文件后會(huì)在/var/lib/solr/collectionName /conf這個(gè)目錄下產(chǎn)生很多配置文件

我們可以根據(jù)自己的需要修改schema.xml文件,具體schema.xml的修改規(guī)則可以參看:http://wiki.apache.org/solr/SchemaXml

2.創(chuàng)建 collectionName實(shí)例并將配置文件上傳到 zookeeper:

solrctl?instancedir?--createcollectionName/var/lib/solr/collectionName

可以通過(guò)下面命令查看上傳的實(shí)體:

solrctl instancedir --list

也可以通過(guò)zookeeper的bin目錄下zkCli.sh查看zookeeper中的文件(ls /)

上傳到 zookeeper 之后,其他節(jié)點(diǎn)就可以從上面下載配置文件。

3.創(chuàng)建 collection:

solrctl collection --createcollectionName-s 3 -r 2 -m3 ?//-m未指定會(huì)報(bào)錯(cuò)(Cannot create collection collectionName. Value of maxShardsPerNode is 1, and the number of live nodes is 3. This allows a maximum of 3 to be created. Value of numShards is 3 and value of replicationFactor is 2. This requires 6 shards to be created (higher than the allowed number))

其中-s表示設(shè)置Shard數(shù)為3,-r表示設(shè)置的replica數(shù)為2,-m表示maxShardsPerNode?為3。安裝以上步驟solr的實(shí)例就算創(chuàng)建完畢 ,可以通過(guò)http://IP:8983/solr/#/~cloud查看創(chuàng)建的Collection。

安裝之后的solrcloud

命令幫助

[root@sxjdb03 solr]# solrctl --help

Options:

--solr solr_uri

--zk? ?zk_ensemble

--jaas jaas.conf

--help

--quiet

Commands:

init? ? ? ? [--force]

instancedir [--generate path [-schemaless]] --生成collection試題文件,path為本地路徑

[--create name path] --創(chuàng)建collection實(shí)例并將配置文件上傳到zookeepername為collection名字,path為本地配置文件的路徑

[--update name path] --修改schema.xml文件之后,需要更新zookeeper中的文件,name為collection名字,path為本地路徑

[--get name path]

[--delete name]

[--list]

config? ? ? [--create name baseConfig [-p name=value]...]

[--delete name]

collection? [--create name -s

[-a Create collection with autoAddReplicas=true]

[-c ]

[-r ]

[-m ]

[-n ]]

[--delete name]

[--reload name] --zookeeper中的配置文件更新完之后需要重新加載shemale.xml文件 name為collection名字

[--stat name]

[--deletedocs name]

[--list]

core? ? ? ? [--create name [-p name=value]...]

[--reload name]

[--unload name]

[--status name]

cluster? ? ?[--get-solrxml file]

[--put-solrxml file]

[--set-property name value]

[--remove-property name]

[--get-clusterstate file]

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容