solrCloud单个配置文件更新后该如何上传zookeeper

发布时间:2021-12-24 17:15:57 作者:柒染
来源:亿速云 阅读:189

本篇文章给大家分享的是有关solrCloud单个配置文件更新后该如何上传zookeeper,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

如果solrcloud的配置文件更新了,那么应该怎么上传更新到zookeeper
一.用zookeeper的zkCli.sh命令连接上zookeeper
进入zookeeper的bin目录,然后执行如下命令:
[root@elk3 bin]# ./zkCli.sh
Connecting to localhost:2181
2018-01-09 10:21:57,985 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
2018-01-09 10:21:57,992 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=elk3
2018-01-09 10:21:57,993 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.8.0_111
2018-01-09 10:21:57,997 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2018-01-09 10:21:57,997 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/usr/local/jdk/jre
2018-01-09 10:21:57,997 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/data/solrcloud/zookeeper-3.4.10/bin/../build/classes:/data/solrcloud/zookeeper-3.4.10/bin/../build/lib/*.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/slf4j-log4j12-1.6.1.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/slf4j-api-1.6.1.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/netty-3.10.5.Final.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/log4j-1.2.16.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/jline-0.9.94.jar:/data/solrcloud/zookeeper-3.4.10/bin/../zookeeper-3.4.10.jar:/data/solrcloud/zookeeper-3.4.10/bin/../src/java/lib/*.jar:/data/solrcloud/zookeeper-3.4.10/bin/../conf:
2018-01-09 10:21:57,998 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2018-01-09 10:21:57,998 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2018-01-09 10:21:57,998 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=<NA>
2018-01-09 10:21:57,998 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2018-01-09 10:21:57,998 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2018-01-09 10:21:57,999 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=2.6.32-504.el6.x86_64
2018-01-09 10:21:57,999 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=root
2018-01-09 10:21:57,999 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/root
2018-01-09 10:21:58,000 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/data/solrcloud/zookeeper-3.4.10/bin
2018-01-09 10:21:58,002 [myid:] - INFO  [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@67424e82
Welcome to ZooKeeper!
2018-01-09 10:21:58,048 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2018-01-09 10:21:58,190 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@876] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2018-01-09 10:21:58,205 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x1608cd4eb18007e, negotiated timeout = 30000


WATCHER::


WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] 


二.查看配置文件:
[zk: localhost:2181(CONNECTED) 1] ls /configs
[topic, chenfeng]
[zk: localhost:2181(CONNECTED) 2] ls /configs/topic
[currency.xml, protwords.txt, managed-schema, solrconfig.xml, synonyms.txt, elevate.xml, stopwords.txt, params.json, lang]
[zk: localhost:2181(CONNECTED) 3] ls


三.删除对应配置文件组目录下的配置文件,删除文件命令可以用delete或rmr
[zk: localhost:2181(CONNECTED) 4] delete /configs/topic/managed-schema    (备注:也可以用rmr /configs/topic/managed-schema)
[zk: localhost:2181(CONNECTED) 5] 



四.上传单个文件命令:
solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 192.168.0.1:2281,192.168.0.2:2181  -cmd putfile /configs/chenfeng/managed-schema /data/solrcloud/solr/server/solr/configsets/basic_configs/conf/managed-schema

上传配置文件目录方法:
solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 192.168.16.65:2281,192.168.184.120:2181  -cmd upconfig -confdir /data/solrcloud/solr/server/solr/configsets/basic_configs/conf -confname topic
这里注意,confname应写为solr集合的名字,否则会在界面里找不到对应的配置文件


连接zookeeper再次查看上传的文件:
[zk: localhost:2181(CONNECTED) 3] ls /configs/topic
[currency.xml, protwords.txt, managed-schema, solrconfig.xml, synonyms.txt, elevate.xml, stopwords.txt, params.json, lang]
[zk: localhost:2181(CONNECTED) 4] 
[zk: localhost:2181(CONNECTED) 4] 
[zk: localhost:2181(CONNECTED) 4] get /configs/topic/managed-schema
<?xml version="1.0" encoding="UTF-8"?>
<!-- Solr managed schema - automatically generated - DO NOT EDIT -->
<schema name="nutch" version="1.6">
  <uniqueKey>kvUuid</uniqueKey>
  <defaultSearchField>kvTitle</defaultSearchField>
  <solrQueryParser defaultOperator="AND"/>
  <fieldType name="ancestor_path" class="solr.TextField">
    <analyzer type="index">
      <tokenizer class="solr.KeywordTokenizerFactory"/>
    </analyzer>
    <analyzer type="query">
      <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/"/>
    </analyzer>
  </fieldType>
  <fieldType name="binary" class="solr.BinaryField"/>
  <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
  <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
  <fieldType name="currency" class="solr.CurrencyField" currencyConfig="currency.xml" defaultCurrency="USD" precisionStep="8"/>

五. 重新reload集合或者重启solrcloud:
http://192.168.184.120:8080/solr/admin/collections?action=RELOAD&name=topic

以上就是solrCloud单个配置文件更新后该如何上传zookeeper,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。

推荐阅读:
  1. 单个文件上传
  2. 配置文件更新展示

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

solrcloud zookeeper

上一篇:SkyArk是一款什么工具

下一篇:linux中如何删除用户组

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》