메뉴 건너뛰기

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
번호 제목 날짜 조회 수
601 hadoop cluster구성된 노드를 확인시 Capacity를 보면 색이 붉은색으로 표시되어 있는 경우나 Unhealthy인 경우 처리방법 2017.08.30 233
600 https용 인증서 발급 명령문 예시및 오류 메세지 2018.01.24 233
599 HAX is not working and emulator runs in emulation mode 메세지가 나오는 경우 file 2015.05.25 235
598 운영중인 상태에서 kafka topic삭제하고 재생성하여 처리되지 않은 메세지 모두 삭제하기 2016.10.24 235
597 [Ranger]계정에 admin권한(grant, create등)의 권한 부여 방법 2023.04.18 235
596 test333 2017.05.01 236
595 php auction 프로그램 2017.05.14 236
594 Ubuntu에서 sbt및 scala설치하기 2017.06.20 236
593 drools를 이용한 로그,rule matching등의 테스트 java프로그램 file 2016.07.21 237
592 센서테스트 file 2015.05.25 238
591 sparql에서 concat에제 2015.11.27 238
590 halyard 1.3의 console을 이용하여 100억건의 데이타에 대한 쿼리수행시 ScannerTimeoutException 발생시 조치사항 2017.09.06 242
589 [PHP7.0]로그파일 위치 2017.05.07 243
588 bin/cassandra -f -R로 startup할때 NullPointerException오류가 나면 조치할 내용 2016.04.14 244
587 Lagom에서 제공하는 Maven을 이용한 Hello프로젝트 자동생성 및 실행 2018.01.19 245
586 에러 추적(Error Tracking) 및 로그 취합(logging aggregation) 시스템인 Sentry 설치 2018.03.14 245
585 jar파일의 dependency찾는 프로그램 2016.08.11 246
584 git 초기화(Windows에서 Git Bash사용) 2016.11.17 246
583 solrcloud에 solrdf1.1설치하고 테스트 하기 2016.04.22 248
582 magento2 2.1.3을 수동으로 설치하는 방법 2017.02.01 248
위로