solr配置

 

 

1.配置好solr应用 以及solrhome (端口,solr应用的web.xml中 配置的solrhome地址)

   配置好solrhome中的服务ip和端口.

2.配置JAVA_OPTS

JAVA_OPTS="-DzkHost=192.168.25.154:2181,192.168.25.154:2182,192.168.25.154:2183"         红色字体的ip表示zookeeper集群的ip以及端口号

3.将solr配置提交到zookeper (有点不理解这步的作用)

 ./zkcli.sh -zkhost 192.168.25.154:2181,192.168.25.154:2182,192.168.25.154:2183 -cmd upconfig -confdir /usr/local/solrcloud/solrhome1/collection1/conf -confname myconf

 红色字体部分的ip表示zookeeper集群的ip地址以及对应的端口。

 

查看配置文件是否上传成功(注:是查看zookeeper 中的配置,所以zkCli.sh 是zookeeper bin下的文件):

[root@bogon bin]# ./zkCli.sh

Connecting to localhost:2181

[zk: localhost:2181(CONNECTED) 0] ls /

[configs, zookeeper]

[zk: localhost:2181(CONNECTED) 1] ls /configs

[myconf]

[zk: localhost:2181(CONNECTED) 2] ls /configs/myconf

[admin-extra.menu-top.html, currency.xml, protwords.txt, mapping-FoldToASCII.txt, _schema_analysis_synonyms_english.json, _rest_managed.json, solrconfig.xml, _schema_analysis_stopwords_english.json, stopwords.txt, lang, spellings.txt, mapping-ISOLatin1Accent.txt, admin-extra.html, xslt, synonyms.txt, scripts.conf, update-script.js, velocity, elevate.xml, admin-extra.menu-bottom.html, clustering, schema.xml]

[zk: localhost:2181(CONNECTED) 3]

 

solrcloud另一种方式

http://www.cnblogs.com/zl0372/p/6444881.html

 

 

 

cd /Users/fengbin/soft/solr/solr-6.4.1/server/scripts/cloud-scripts

 

solr 下的脚本更新配置 testsolrconfig 为配置文件

./zkcli.sh -zkhost 127.0.0.1:2181 -cmd upconfig -confdir /Users/fengbin/soft/solr/solrhome1/testsolr/conf/ -confname testsolrconfig

 

 

 -------创建订单明细配置---------

cd /Users/fengbin/soft/solr/solr-6.4.1/server/scripts/cloud-scripts

./zkcli.sh -zkhost 127.0.0.1:2181 -cmd upconfig -confdir /Users/fengbin/soft/solr/solrhome1/orderDetail/conf -confname orderDetailConf

http://localhost:8980/solr/admin/collections?action=CREATE&name=orderDetailSolr&numShards=2&replicationFactor=2&collection.configName=orderDetailConf 

 

删除collections

 http://localhost:8980/solr/admin/collections?action=DELETE&name=collection2

 

具体参见:http://www.cnblogs.com/append/p/5747956.html

http://blog.csdn.net/zwx19921215/article/details/38428099

solrCloud相关概念理解

http://www.bubuko.com/infodetail-940759.html

猜你喜欢

转载自fengbin2005.iteye.com/blog/2360405