메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, 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
번호 제목 글쓴이 날짜 조회 수
119 java.lang.IllegalArgumentException: Does not contain a valid host:port authority: master 오류해결방법 총관리자 2015.05.06 449
118 hadoop 2.6.0 기동(에코시스템 포함)및 wordcount 어플리케이션을 이용한 테스트 총관리자 2015.05.05 3769
117 oozie 4.1 설치 - maven을 이용한 source compile on hadoop 2.5.2 with postgresql 9.3 총관리자 2015.04.30 861
116 hive 0.13.1 설치 + meta정보는 postgresql 9.3에 저장 총관리자 2015.04.30 227
115 HBase 0.98.12(1.2.5) for hadoop2 설치-5대에 완전분산모드 (HDFS HA상테) 총관리자 2015.04.29 1047
114 Hadoop - 클러스터 세팅및 기동 총관리자 2015.04.28 427
113 zookeeper 3.4.6 설치(3대) 총관리자 2015.04.28 1209
112 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable원인 총관리자 2015.04.27 322
111 bananapi 5대(ubuntu계열 리눅스)에 yarn(hadoop 2.6.0)설치하기-ResourceManager HA/HDFS HA포함, JobHistory포함 총관리자 2015.04.24 19143
110 scan의 startrow, stoprow지정하는 방법 총관리자 2015.04.08 375
109 SASL configuration failed: javax.security.auth.login.LoginException: java.lang.NullPointerException 오류 해결방법 총관리자 2015.04.02 701
108 kafka의 re-balance를 이용하여 consumer를 multi thread로 돌려서 topic의 partitions을 활용 총관리자 2015.03.31 248
» Using The ZooKeeper CLI에서 zkCli의 위치 총관리자 2014.11.02 881
106 [번역] solr 검색 엔진 튜토리얼 총관리자 2014.10.07 441
105 solr vs elasticsearch 비교2 총관리자 2014.09.29 1276
104 solr설치및 적용관련 file 총관리자 2014.09.27 2124
103 solr에서 한글사용시 주의점 총관리자 2014.09.26 599
102 RHadoop을 통해서 웹사이트의 방문자수를 예측하는 방법 총관리자 2014.09.26 2007
101 로그 파일에 대해 Elasticsearch 사용하기 총관리자 2014.09.25 1121
100 호튼웍스 하둡을 검색엔진과 연동하는 방법과 아키텍쳐 총관리자 2014.09.25 1141

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로