SolrCloud Collection 创建
来源:互联网 发布:php object to string 编辑:程序博客网 时间:2024/03/29 13:59
环境版本: CDH 5.12.0; Solr 4.10.3
CDH搭建SolrCloud集群十分方便,添加服务->solr->选择主机->next即可在SolrCloud中,跨多个节点的索引分割称为集合(collection),见下图:
[root@DXHY-YFEB-01 solr]# pwd/var/lib/solr[root@DXHY-YFEB-01 solr]# mv Invoice_bak/ test_invoice[root@DXHY-YFEB-01 solr]# ls#创建 collection 实例并将配置文件上传到 zookeeper[root@DXHY-YFEB-01 solr]# solrctl instancedir --create test_invoice ./test_invoice#在Zookeeper查看配置文件[root@DXHY-YFEB-01 solr]# zookeeper-client[zk: localhost:2181(CONNECTED) 1] ls /solr[configs, overseer, aliases.json, live_nodes, collections, overseer_elect, clusterstate.json, solr.xml, zkdtsm, clusterprops.json, token][zk: localhost:2181(CONNECTED) 2] ls /solr/configs[realestate, schemalessTemplateSecure, managedTemplate, schemalessTemplate, predefinedTemplate, managedTemplateSecure, predefinedTemplateSecure, test_invoice]#查看上传的实体[root@DXHY-YFEB-01 solr]# solrctl instancedir --list managedTemplatemanagedTemplateSecurepredefinedTemplatepredefinedTemplateSecurerealestateschemalessTemplateschemalessTemplateSecuresolrtesttest_invoice#创建 collection[root@DXHY-YFEB-01 solr]# solrctl collection --create test_invoice -s 2 -c test_invoice -r 2 -m 3#如果新集合可以使用与现有集合一样的配置文件,不需重新复制上传[root@DXHY-YFEB-01 solr]# solrctl collection --create test_invoice2 -s 2 -c test_invoice -r 2 -m 3#-c <collection.configName> -s <numShards> -r <replicationFactor> -m <maxShardsPerNode>#注意:numShards*replicationFactor <= maxShardsPerNode*numNode#更新配置,更新后新建的索引会按更新后的配置创建,之前的不变。[root@DXHY-YFEB-01 solr-doc-4.10.3+cdh5.12.0+513]# solrctl instancedir --update test_invoice ./test_invoiceUploading configs from ./realestate/conf to DXHY-YFEB-03:2181,DXHY-YFEB-01:2181,DXHY-YFEB-02:2181/solr. This may take up to a minute.[root@DXHY-YFEB-01 solr-doc-4.10.3+cdh5.12.0+513]# solrctl collection --reload test_invoice
备注:solrctl命令solrctl [options] command [command-arg] [command [command-arg]] ... 可选参数有: --solr:指定 SolrCloud 的 web API,如果在 SolrCloud 集群之外的节点运行命令,就需要指定该参数。 --zk:指定 zk 集群solr目录。 --help:打印帮助信息。 --quiet:静默模式运行。 command 命令有: init [--force]:初始化配置。 instancedir:维护实体目录。可选的参数有: --generate path --create name path --update name path --get name path --delete name --list collection:维护 collections。可选的参数有: --create name -s <numShards> [-c <collection.configName>] [-r <replicationFactor>] [-m <maxShardsPerNode>] [-n <createNodeSet>]] --delete name: Deletes a collection. --reload name: Reloads a collection. --stat name: Outputs SolrCloud specific run-time information fora collection. --list: Lists all collections registered in SolrCloud. --deletedocs name: Purges all indexed documents from a collection. core:维护 cores。可选的参数有: --create name [-p name=value]...] --reload name: Reloads a core. --unload name: Unloads a core. --status name: Prints status of a core. cluster:维护集群配置信息。可选的参数有: --get-solrxml file --put-solrxml file#全的参数列表[root@DXHY-YFEB-03 kylin]# solrctl --helpusage: /opt/cloudera/parcels/CDH-5.12.0-1.cdh5.12.0.p0.29/bin/../lib/solr/bin/solrctl.sh [options] command [command-arg] [command [command-arg]] ...Options: --solr solr_uri --zk zk_ensemble --jaas jaas.conf --help --quiet --debug Prints error output of calls --trace Prints executed commandsCommands: init [--force] instancedir [--generate path [-schemaless]] [--create name path] [--update name path] [--get name path] [--delete name] [--list] config [--create name baseConfig [-p name=value]...] [--delete name] collection [--create name -s <numShards> [-a Create collection with autoAddReplicas=true] [-c <collection.configName>] [-r <replicationFactor>] [-m <maxShardsPerNode>] [-n <createNodeSet>]] [--delete name] [--reload name] [--stat name] [--deletedocs name] [--list] [--create-snapshot snapshotName -c <collectionName>] [--delete-snapshot snapshotName -c <collectionName>] [--list-snapshots collectionName] [--describe-snapshot snapshotName -c <collectionName>] [--prepare-snapshot-export snapshotName -c <collectionName> -d <destDir> [-p <fsPathPrefix>]] [--export-snapshot snapshotName [-s <sourceDir>] [-c <collectionName>] -d <destDir>] [--restore name -b <backupName> -l <backupLocation> -i <requestId> [-a Restore collection with autoAddReplicas=true] [-c <collection.configName>] [-r <replicationFactor>] [-m <maxShardsPerNode>]] [--request-status requestId] 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] sentry [--create-role role] [--drop-role role] [--add-role-group role group] [--delete-role-group role group] [--list-roles [-g group]] [--grant-privilege role privilege] [--revoke-privilege role privilege] [--list-privileges role] [--convert-policy-file file [-dry-run]]
参考链接:http://blog.csdn.net/kissmelove01/article/details/45043955
阅读全文
0 0
- SolrCloud Collection 创建
- solrcloud线上创建collection,修改默认配置
- SolrCloud根据表结构创建Collection
- solrcloud线上创建collection,修改默认配置
- SolrCloud 5.0 路由、Collection创建与数据迁移
- SolrCloud 5.0 路由、Collection创建与数据迁移
- solr入门之创建solrcloud的collection索引集合
- SolrCloud 5.0 路由、Collection创建与数据迁移,solrcloud文档路由
- solrcloud上传collection配置
- solrcloud操作collection
- SolrCloud 与 Collection 的管理
- mapreduce创建solrcloud索引
- mapreduce创建solrcloud索引
- mapreduce创建solrcloud索引
- SolrCloud中的文件与Collection管理
- [置顶] SolrCloud中的文件与Collection管理
- SolrCloud中的文件与Collection管理
- SolrCloud中的文件与Collection管理
- Android 6.0动态权限申请问题
- 关于html中meta viewport属性
- C++/C 宏定义(define)中# ## 的含义
- caffe 中的一些参数介绍
- PyTorch 深度学习:60分钟快速入门
- SolrCloud Collection 创建
- opengl es文档
- ZigZag Conversion--LeetCode
- OpenG数组讲解之Filter 1D Array。
- redis-GEO地理位置
- IO和NIO操作文件的对比
- Android Studio SDK Manager 解决无法更新问题
- 海盗喝酒
- 机器学习笔记(10)-K-均值(K-means)