solr

#简介
apache全文搜索引擎


#getting started
https://lucene.apache.org/solr/guide/7_1/solr-tutorial.html


#下载
http://lucene.apache.org/solr/downloads.html


#解压
unzip -q solr-7.1.0.zip


#运行cloud示例
./bin/solr start -e cloud




#配置home目录
vi /etc/profile
export $APACHE_SOLR_HOME=/opt/solr-5.5.5






#==========================cdh solr4.10配置core =====================================================
#参考
http://blog.csdn.net/kissmelove01/article/details/45043955


1.生产实体配置文件
solrctl instancedir --generate nutch


2.创建 collection1 实例并将配置文件上传到 zookeeper
solrctl instancedir --create nutchtest nutch
#修改
solrctl instancedir --update nutchtest nutch


3.查看上传的实体
solrctl instancedir --list


4.上传到 zookeeper 之后,其他节点就可以从上面下载配置文件。接下来创建 collection
#其中-s表示设置Shard数为2,-r表示设置的replica数为2。
solrctl collection --create nutchtest -s 1 -r 1
#删除
solrctl collection --delete nutchtest
#增加share
solrctl --solr http://<target_solr_server>:8983/solr core --create <core_name> \
-p dataDir=hdfs://<nameservice>/<index_hdfs_path> -p collection.configName=<config_name> \
-p collection=<collection_name> -p numShards=<int> -p shard=<shard_id>  


5.启动服务并访问
bin/solr start


http://100.100.100.242:8983










#=========================solr5.5配置core=====================================================


#create resources for a new nutch solr core
cp -r ${APACHE_SOLR_HOME}/server/solr/configsets/basic_configs ${APACHE_SOLR_HOME}/server/solr/configsets/nutch


#copy the nutch schema.xml into the conf directory
cp ${NUTCH_RUNTIME_HOME}/conf/schema.xml ${APACHE_SOLR_HOME}/server/solr/configsets/nutch/conf


#make sure that there is no managed-schema "in the way":
rm ${APACHE_SOLR_HOME}/server/solr/configsets/nutch/conf/managed-schema


#start the solr server
${APACHE_SOLR_HOME}/bin/solr start


#create the nutch core
${APACHE_SOLR_HOME}/bin/solr create -c nutch -d ${APACHE_SOLR_HOME}/server/solr/configsets/nutch/conf/


#vi schema.xml 删除 enablePositionIncrements=true
vi ${APACHE_SOLR_HOME}/server/solr/configsets/nutch/conf/schema.xml
/enablePositionIncrements
n
i
del


#add the core name to the Solr server URL:
-Dsolr.server.url=http://localhost:8983/solr/nutch


#start
${APACHE_SOLR_HOME}/bin/solr start


#删除所有数据
documents目录下 xml模式  documents内容
 <delete><query>*:*</query></delete><commit/>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值