메뉴 건너뛰기

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
번호 제목 글쓴이 날짜 조회 수
179 bash는 PS1 변수를 통해 프롬프트의 모양을 바꿀 수 있다. 총관리자 2016.03.30 38
178 CentOS의 서버 5대에 yarn(hadoop 2.7.2)설치하기-ResourceManager HA/HDFS HA포함, JobHistory포함 총관리자 2016.03.29 1138
177 CentOS에서 리눅스(Linux) 포트 열기, 방화벽 설정/해제 등. 총관리자 2016.03.14 231
176 Spark Streaming으로 유실 없는 스트림 처리 인프라 구축하기 총관리자 2016.03.11 137
175 System Properties Comparison Elasticsearch vs. Hive vs. Jena file 총관리자 2016.03.10 285
174 TopBraid Composer에서 SPIN 사용법 file 총관리자 2016.02.25 104
173 SPIN(SPARQL Inference Notation)이란.. file 총관리자 2016.02.25 73
172 SPARQL의 유형, SPARQL 만들기등에 대한 설명 총관리자 2016.02.18 274
171 select와 group by결과 값이 없는경우의 리턴 값이 다름 file 총관리자 2016.02.05 119
170 ?a는 모두 표시하면서 ?b와 비교하여 ?a=?b는 ""로 하고 ?a!=?b 인경우는 해당값을 가지는 결과 집합을 구하는 경우 file 총관리자 2016.01.29 144
169 ?a는 모두 표시하면서 ?b와 비교하여 ?a=?b는 표시하고 ?a!=?b 인경우는 ""로 구성된 결과 집합을 구하는 경우 file 총관리자 2016.01.29 255
168 null 혹은 ""를 체크하는 방법 총관리자 2016.01.27 160
167 sparql 1.1 BIND(if() as ?bind변수) 버그로 추정되는 문제점및 해결방안 -> select 문에 (if(,,) as ?bind변수) file 총관리자 2016.01.21 257
166 CDH 5.4.4 버전에서 hive on tez (0.7.0)설치하기 총관리자 2016.01.14 158
165 한번에 여러값 update하기 총관리자 2016.01.13 134
164 문자열을 숫자(integer)로 casting하기 총관리자 2016.01.13 175
163 update(update와 delete->insert)사용시 주의/참고사항 총관리자 2016.01.06 146
162 fuseki에 update하는 방법(java api이용)및 주의 사항 총관리자 2015.12.30 258
161 mongodb에서 큰데이타 sort시 오류발생에 대한 해결방법 총관리자 2015.12.22 145
160 console명령과 API비교 총관리자 2015.12.21 120

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.

위로