메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


아래에서 example/solr-webapp/WEB-INF/lib/*

org.apache.solr.cloud.ZkCLI 로 언급된것은.. 배포하는 solr-4.10.1.zip파이을 압축해제하면
E:solrsolr-4.10.1solr-4.10.1examplesolr-webapp에 있는데.. 처음 압축해제하면 보이지 않고..
E:solrsolr-4.10.1solr-4.10.1example에 있는 start.jar를 실행(윈도우에서 더블클릭..)하면
examplesolr-webapp밑에 파일이 생성된다.
특히 zkCli는 E:solrsolr-4.10.1solr-4.10.1examplesolr-webappwebappWEB-INFlibsolr-cor-4.10.1.jar파일에 들어 있음..
 
맨밑에 있는 scripts파일은
E:solrsolr-4.10.1solr-4.10.1examplescriptscloud-scripts에 위치하고 있음
 

ZooKeeper has a utility that lets you pass command line parameters: zkcli.bat (for Windows environments) and zkcli.sh (for Unix environments).

zkcli Parameters

Short

Parameter Usage

Meaning

 

-cmd <arg>

CLI Command to be executed: bootstrap, upconfig, downconfig, linkconfig, makepath, get, getfile, put, putfile, list or clear. 
This parameter is mandatory

-h

-help

Display help text.

-s

-solrhome <path>

For bootstrap or when using -runzk: the mandatory solrhome location.

-c

-collection <name>

For linkconfig: name of the collection.

-n

-confname <arg>

For upconfig, linkconfig: name of the configuration set.

-d

-confdir <path>

For upconfig: a directory of configuration files.

-r

-runzk <port>

Run ZooKeeper internally by passing the Solr run port; only for clusters on one machine.

-z

-zkhost <locations>

ZooKeeper host address. 
This parameter is mandatory for all CLI commands.

The short form parameter options may be specified with a single dash (eg: -c mycollection).
The long form parameter options may be specified using either a single dash (eg: -collection mycollection) or a double dash (eg: --collection mycollection)

ZooKeeper CLI Examples

Below are some examples of using the zkcli CLI:

Uploading a Configuration Directory

java -classpath example/solr-webapp/WEB-INF/lib/*
     org.apache.solr.cloud.ZkCLI -cmd upconfig -zkhost 127.0.0.1:9983
     -confdir example/solr/collection1/conf -confname conf1 -solrhome  example/solr

Put arbitrary data into a new ZK file

java -classpath example/solr-webapp/WEB-INF/lib/*
     org.apache.solr.cloud.ZkCLI -zkhost 127.0.0.1:9983 -put /data.txt 'some data'

Put a local file into a new ZK file

java -classpath example/solr-webapp/WEB-INF/lib/*
     org.apache.solr.cloud.ZkCLI -zkhost 127.0.0.1:9983 -putfile /data.txt /some/local/file.txt

Linking a Collection to a Configuration Set

java -classpath example/solr-webapp/webapp/WEB-INF/lib/*
     org.apache.solr.cloud.ZkCLI -cmd linkconfig -zkhost 127.0.0.1:9983
     -collection collection1 -confname conf1 -solrhome example/solr

Bootstrapping All the Configuration Directories in solr.xml

java -classpath example/solr-webapp/webapp/WEB-INF/lib/*
     org.apache.solr.cloud.ZkCLI -cmd bootstrap -zkhost 127.0.0.1:9983
     -solrhome example/solr

Scripts

There are scripts in example/cloud-scripts that handle the classpath and class name for you if you are using Solr out of the box with Jetty. Commands then become:

sh zkcli.sh -cmd linkconfig -zkhost  127.0.0.1:9983
     -collection collection1 -confname conf1 -solrhome example/solr
번호 제목 날짜 조회 수
121 거침없이 배우는 Drools 책의 샘플소스 file 2016.07.22 1369
120 자주쓰는 유용한 프로그램 2018.03.16 1385
119 우분투 root 패스워드 설정하기 2013.03.04 1395
118 Oozie 설치, 환경설정 및 테스트 2014.04.08 1405
117 lagom-linux용 build.sbt파일 내용 2017.10.12 1417
116 crypto관련 기생충 박멸 스크립트 2018.05.11 1421
115 solr vs elasticsearch 비교2 2014.09.29 1432
114 mysql에서 외부 디비를 커넥션할 경우 접속 속도가 느려질때 2017.06.30 1437
113 avro 사용하기(avsc 스키마 파일 컴파일 방법, consumer, producer샘플소스) 2016.07.08 1458
112 Mybatis foreach 문법정리(상황에 따른 사용법) 2015.11.10 1464
111 build.gradle을 pom.xml로 변환하는 방법 2016.08.18 1483
110 ubuntu 커널 업그레이드 방법 2018.09.02 1486
109 resouce manager에 dr.who가 아닌 다른 사용자로 로그인 하기 2018.06.28 1487
108 The disk drive for uuid= is not ready yet or not present 오류 해결방법 2014.04.21 1501
107 apt-get install mysql-server수행시 "404 Not Found" 오류발생시 조치방법 2014.09.10 1507
106 마이바티스(MyBatis)쿼리로그 출력및 정렬하기 2015.12.01 1546
105 hiverserver2기동시 connection refused가 발생하는 경우 조치방법 2014.05.22 1560
104 ExWordCount jar파일 file 2013.03.06 1563
103 FAILED: IllegalStateException Variable substitution depth too large: 40 오류발생시 조치사항 2014.08.19 1597
102 sqoop에서 oracle관련 작업할때 테이블명, 사용자명, DB명은 모두 대문자로 사용할것 2014.05.15 1599
위로