solr实践
来源:互联网 发布:如何开淘宝网店视频 编辑:程序博客网 时间:2024/05/17 22:40
脚本执行:
单机:bin/slor start修改solr配置文件:vim solr.in.sh
伪分布式zk节点数至少3个集群才能生效
创建集合
自动路由
/bin/solr create_collection -c wish_item -d /Users/zhanxf/hadoop/solr-5.3.1_copy/server/solr/erp_wish_item1/conf -s 2 -rf 1
手动路由
curl http://localhost:8983/solr/admin/collections?action=CREATE&name=wish_item&router.name=implicit&shards=shard1,shard2,shard3,shard4,shard5,shard6&maxShardsPerNode=6
删除节点 curl http://localhost:8983/solr/admin/collections?action=DELETE&name=wish_item
单片搜索
http://localhost:8983/solr/testimplicit_shard1_replica1/select?q=*%3A*&wt=json&indent=true&debugQuery=true&shards=shard2
线上操作(集群环境)
虚拟机内存设置
SOLR_HEAP="12288M"SOLR_JAVA_MEM="-Xms12288m -Xmx12288m"SOLR_TIMEZONE="GMT+08:00”
上传宝贝配置文件
sh /data/project/solr-5.3.1/server/scripts/cloud-scripts/zkcli.sh -z zoo6.superboss.cc:30004,zoo5.superboss.cc:30004,zoo4.superboss.cc:30004 -cmd putfile /configs/wish_item/data-config.xml /data/project/wish_item_conf/data-config.xml
上传店铺配置文件
sh /data/project/solr-5.3.1/server/scripts/cloud-scripts/zkcli.sh -z zoo6.superboss.cc:30004,zoo5.superboss.cc:30004,zoo4.superboss.cc:30004 -cmd putfile /configs/wish_merchant/data-config.xml /data/project/wish_merchant_conf/data-config.xml
创建店铺core
sh solr create_collection -c wish_merchant -d /data/project/wish_merchant_conf
创建宝贝core
curl "http://121.41.43.155:30005/solr/admin/collections?action=CREATE&name=wish_item&router.name=implicit&shards=shard1,shard2,shard3,shard4,shard5,shard6&maxShardsPerNode=6”
关联配置文件和core
sh /data/project/solr-5.3.1/server/scripts/cloud-scripts/zkcli.sh -z zoo6.superboss.cc:30004,zoo5.superboss.cc:30004,zoo4.superboss.cc:30004 -cmd linkconfig -collection wish_item -confname wish_item
上传配置文件到zk
sh /data/project/solr-5.3.1/server/scripts/cloud-scripts/zkcli.sh -z zoo6.superboss.cc:30004,zoo5.superboss.cc:30004,zoo4.superboss.cc:30004 -cmd upconfig -confdir /data/project/wish_item_conf -confname wish_item
注意点:
名称搜索空格用+代替: Luxury+Temperedfq:加速缓存查询fl:过滤查询字段[]包含头尾 {}不包含头尾,()用于构成子查询
SOLR安装常见问题
更新zk配置文件(managed-schema|data-config.xml):
./../../../scripts/cloud-scripts/zkcli.sh -z localhost:2181,localhost:2182,localhost:2183 -cmd putfile /configs/wish_item/data-config.xml /Users/zhanxf/hadoop/solr-5.3.1_copy/server/solr/erp_wish_item1/conf/data-config.xmlsolr.in.sh集群配置(集群配置jvm配置内存至少1G)ZK_HOST="localhost:2181,localhost:2182,localhost:2183"SOLR_JAVA_MEM="-Xms1G -Xmx1G”
导入失败,将附加jar复制到solr-webapp/WEB-INFO/lib目录下
mmseg4j-core-1.10.0.jarmmseg4j-solr-2.3.0.jarmysql-connector-java-5.1.18-bin.jarsolr-dataimporthandler-5.3.1.jarsolr-dataimporthandler-extras-5.3.1.jar
编写solr插件问题,编译失败,上传下面2个jar到本地maven
mvn install:install-file -DgroupId=org.apache.solr.handler.dataimport
-DartifactId=solr-dataimporthandler -Dversion=5.3.1 -Dpackaging=jar -Dfile=solr-dataimporthandler-5.3.1.jarmvn install:install-file -DgroupId=org.restlet.jee
-DartifactId=org.restlet -Dversion=2.3.0 -Dpackaging=jar -Dfile=org.restlet-2.3.0.jarmvn install:install-file -DgroupId=org.restlet.jee
-DartifactId=org.restlet.ext.servlet -Dversion=2.3.0 -Dpackaging=jar -Dfile=org.restlet.ext.servlet-2.3.0.jar
问题排查常用命令
grep "concurrent mode failure" solr_gc_log_20170711_* | wc -ljstat -gcutil 15611 5000 10jstack 15611
- Solr实践
- solr实践
- solr实践
- Solr SpellCheck实践
- solr文档索引最佳实践
- [Solr实践]Solr Cache使用介绍及分析
- Solr集群Replication配置与实践
- 跟我学solr,实践中更新
- 优化solr全量建索引速度实践
- Solr之集群Replication配置与实践
- Solr集群Replication配置与实践
- Solr空间搜索原理分析与实践
- 调用lucene向solr建索引实践
- Solr集群Replication配置与实践
- Solr入门和实践以及我对Solr的8点理解
- solr入门之solr安全控制的研究和实践(一)
- solr入门之solr安全控制的研究和实践(二)
- solr入门之solr安全控制的研究和实践(三) zookeeper访问控制
- 了解glibc的Name Service Switch
- 线性回归简介及python代码实现
- Solr 5,5从Mysql全量、增量导入数据
- Linux-进程环境(shell环境)
- 手机飞行模式“飞不动”?!这才是飞行模式的正确打开方式
- solr实践
- strtok与strtok_r函数应用
- Parallels Desktop13.0.1 破解版
- 024 幂函数、指数函数、对数函数导数公式推导
- Leetcode31 Next Permutation
- 悦享双节,Guitar Pro也来凑份热闹!
- storm ui error:org.apache.thrift7.transport.TTransportException: java.net.ConnectException:
- CodeChef
- Nginx配置性能优化