https://blog.csdn.net/kissmelove01/article/details/45196941
本人一直在用和这个文章一模一样,可以参考。
以下是本人笔记
#创建collection
solrctl instancedir --generate /home/solr/civlist/collectioncivlist
solrctl instancedir --create collectioncivlist /home/solr/civlist/collectioncivlist
solrctl collection --create collectioncivlist -s 3 -r 2 -m 2 -c collectioncivlist
-------
solrctl instancedir --generate /home/solr/civlist/collpatient
solrctl instancedir --create collpatient /home/solr/civlist/collpatient
solrctl collection --create collpatient -s 1 -r 2 -c collpatient
#重新上传配置
solrctl instancedir --update collectioncivlist /home/solr/civlist/collectioncivlist
solrctl collection --reload collectioncivlist
solrctl instancedir --update collpatient /home/solr/civlist/collpatient
solrctl collection --reload collpatient
#查看刚刚创建好的配置实体
solrctl instancedir --list
#删除collection和实体配置
solrctl collection --delete collectioncivlist
solrctl config --delete collectioncivlist
solrctl collection --delete collpatient
solrctl config --delete collpatient
#删除hdfs上节点collection
hdfs dfs -rm -r /solr/collectioncivlist
#清空solr中数据的xml格式语句,慎用。
<delete><query>*:*</query></delete>
<commit/>
#创建实时索引
collectionName $1; 项目路径 $2; ZK_HOST $3
hbase-indexer add-indexer --name HDR_INP_SUMMARY --indexer-conf /usr/local/freeSearch/hbase_indexer_files/HDR_INP_SUMMARY.xml --connection-param solr.zk=192.168.7.108:2181,192.168.7.109:2181,192.168.7.110:2181/solr --connection-param solr.collection=HDR_INP_SUMMARY --zookeeper 192.168.7.108:2181,192.168.7.109:2181,192.168.7.110:2181
创建索引器
hbase-indexer add-indexer --name collpatient --indexer-conf /home/hdr/solr/hbase_indexer_files/solrPatient.xml --connection-param solr.zk=hadoop02:2181,hadoop03:2181,hadoop04:2181/solr --connection-param solr.collection=collpatient --zookeeper hadoop02:2181,hadoop03:2181,hadoop04:2181
查看实时索引
hbase-indexer list-indexers --zookeeper 192.168.7.108:2181,192.168.7.109:2181,192.168.7.110:2181
hbase-indexer list-indexers --zookeeper hadoop02:2181,hadoop03:2181,hadoop04:2181
删除实时索引
hbase-indexer delete-indexer --name shealphySS --zookeeper 192.168.7.108:2181,192.168.7.109:2181,192.168.7.110:2181
hbase-indexer delete-indexer --name collpatient --zookeeper hadoop02:2181,hadoop03:2181,hadoop04:2181
put ' HDR_PATIENT','123456789','cf:PERSON_NAME' ,'Jack'