메뉴 건너뛰기

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
번호 제목 날짜 조회 수
» Using The ZooKeeper CLI에서 zkCli의 위치 2014.11.02 2385
106 [번역] solr 검색 엔진 튜토리얼 2014.10.07 1729
105 solr vs elasticsearch 비교2 2014.09.29 2241
104 solr설치및 적용관련 file 2014.09.27 2979
103 solr에서 한글사용시 주의점 2014.09.26 1531
102 RHadoop을 통해서 웹사이트의 방문자수를 예측하는 방법 2014.09.26 2772
101 로그 파일에 대해 Elasticsearch 사용하기 2014.09.25 2441
100 호튼웍스 하둡을 검색엔진과 연동하는 방법과 아키텍쳐 2014.09.25 1978
99 hadoop 기반 문서 검색 2014.09.25 1864
98 하둡 분산 파일 시스템을 기반으로 색인하고 검색하기 2014.09.25 1769
97 lateral view 예제 2014.09.18 2217
96 root가 localhost에서 mysql로 접근하지 못하는 경우의 해결방법(패스워드) 2014.09.10 1682
95 mysql 5.5.34-0ubuntu0.13.04용 설치/진행 화면 2014.09.10 3831
94 apt-get install mysql-server수행시 "404 Not Found" 오류발생시 조치방법 2014.09.10 2711
93 banana pi에 hive 0.13.1+mysql(metastore)설치 file 2014.09.09 3271
92 원격지에서 zio공유기를 통해서 노트북의 mysql접속을 허용하는 방법 2014.09.07 1970
91 sqoop작업시 hdfs의 개수보다 더많은 값이 중복되어 oracle에 입력되는 경우가 있음 2014.09.02 5150
90 java.util.NoSuchElementException발생시 조치 2014.08.27 2406
89 hadoop의 data디렉토리를 변경하는 방법 2014.08.24 2157
88 시스템날짜를 현재 정보로 동기화 하는 방법(rdate, ntpdate이용) 2014.08.24 2485
위로