메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


1. 다운로드

  http://cassandra.apache.org/download/

  http://www.apache.org/dyn/closer.lua/cassandra/3.4/apache-cassandra-3.4-bin.tar.gz


2. 압축풀기

  tar xvfz apache-cassandra-3.4-bin.tar.gz


3. 링크생성

  ln -s apache-cassandra-3.4 cassandra


4. 환경변수 추가(카산드라가 설치되는 모든 서버에 설정함, root로 실행)

   vi /etc/profile


   #classandra

   export CASSANDRA_HOME=$HOME/cassandra


   *변경사항 반영 

   source /etc/profile


5. ./conf/cassandra.yaml 정보수정(각 노드 모두 수정필요함)

  가. cluster_name: 'GSDA Cluster'

  나. data_file_directories:

    - /data/cassandra/data

  다. commitlog_directory: /data/cassandra/commitlog

  라. saved_caches_directory: /data/cassandra/saved_caches

  라-1. hints_directory: /data/cassandra/hints

  마. listen_address: sda1  (각 서버에 고유한 주소지정)

  바. rpc_address: 0.0.0.0(대표(마스타) 서버는 0.0.0.0으로 하고 나머지 서버도 모두 0.0.0.0으로 지정)

  사. endpoint_snitch: RackInferringSnitch

  아. broadcast_rpc_address: sda1 (각 서버에 고유한 주소지정) <- 1.2.11에서는 지원되지 않음

  자. - seeds: "sda1"로 지정함(cluster에서 대표가 되는 서버의 주소로 지정함)

  차. start_rpc: true로 변경함(defalt는 false) <= 활성화 시켜줘야 client program에서 접근하여 명령을 실행할 수 있다.

       (혹은 start_rpc값을 변경하지 않고, bin/nodetool enablethrift명령를 실행하여 직접 작동시킬 수도 있다)

       => 대표(마스타)서버에서만 실행할것(?)

  카. listen_on_broadcast_address: true

  하. broadcast_address: gsda1(각 서버에 고유한 주소지정)


5-1. 각 서버에 scp로 복사(서버에 특화된 설정값(listen_address, broadcast_address, broadcast_rpc_address)을 바꿀것)

scp -r -P 22 apache-cassandra-3.10 root@gsda2:$HOME

scp -r -P 22 apache-cassandra-3.10 root@gsda3:$HOME

scp -r -P 22 apache-cassandra-3.10 root@gsda4:$HOME

scp -r -P 22 apache-cassandra-3.10 root@gsda5:$HOME

6. cassandra기동(설치된 모든 서버에서 실행, -f는 background가 아닌 foreground로 기동,-R을쓰면 root로 기동할 수 있음(비추천))

  bin/cassandra -R (필요시 -f)


 * cassandra내리기 : ps -ef | grep cassandra해서 pid를 찾고 kill pid로 데몬을 죽여서 cassandra데몬을 내린다.


7. 각종 정보 확인

  가. 디스크 강제 쓰기 : bin/nodetool -h localhost flush  (-h localhost 생략가능)

  나. 요청작업 상태보기 : bin/nodetool -h localhost tpstats (-h localhost 생략가능)

  다. thrift 상태보기 : bin/nodetool -h localhost statusthrift (-h localhost 생략가능)

  라. cfg 상태보기(db크기등) : bin/nodetool -h localhost cfstats (-h localhost 생략가능)

  마. 클러스터 구성 정보 : bin/nodetool status (rpc_address를 0.0.0.0으로 지정햔 서버에서 명령을 주면 데몬이 죽어버림(?))

root@gsda4:~/cassandra/bin# nodetool status
Datacenter: 251
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address          Load       Tokens       Owns (effective)  Host ID                               Rack
UN  104.251.212.191  282.33 KiB  256          49.1%             1de4b4b4-ac78-45c0-9009-051fd09634e6  212
UN  104.251.212.146  219.62 KiB  256          48.0%             0ec06870-f209-4dd8-8013-cc0fe101e57c  212
UN  104.251.212.192  206.73 KiB  256          50.5%             95f9daf7-6b66-435f-9d0d-9bb0b81e4327  212
UN  104.251.212.183  311.93 KiB  256          52.4%             4060b53b-c4e1-42ef-a166-81c44f0bceaf  212

* jps로 데몬이 확인되지 않을 수 있는데 이때는 "ps -ef |grep cass"를 이용하여 확인한다.

* cassandra관련 포트

 7199 JMX monitoring port

 7000 Inter-node cluster

 7001 SSL inter-node cluster

 9042 CQL native Transport Port

 9160 Thrift

 1024-65355  Random port required by JMX, com.sun.management.jmxremote.rmi.port(cassandra-env.sh)를 지정하면

 랜덤하게 부여하지 않고 고정할 수 있다.


번호 제목 글쓴이 날짜 조회 수
740 [CDP7.1.7] oozie sqoop action으로 import혹은 export수행시 발생한 오류에 대한 자세한 로그 확인 하는 방법 gooper 2024.04.19 0
739 [Impala] alter table구문수행시 "WARNINGS: Impala does not have READ_WRITE access to path 'hdfs://nameservice1/DATA/Temp/DB/source/table01_ccd'" 발생시 조치 gooper 2024.04.26 0
738 [CDP7.1.7, Replication]Encryption Zone내 HDFS파일을 비Encryption Zone으로 HDFS Replication시 User hdfs가 아닌 hadoop으로 수행하는 방법 gooper 2024.01.15 1
737 [CDP7.1.7]Hive Replication수행중 Specified catalog.database.table does not exist : hive.db명.table명 오류 발생시 조치방법 gooper 2024.04.05 1
736 [CDP7.1.7][Replication]Table does not match version in getMetastore(). Table view original text mismatch gooper 2024.01.02 2
735 ./gradlew :composeDown 및 ./gradlew :composeUp 를 성공했을때의 메세지 gooper 2023.02.20 6
734 호출 url현황 gooper 2023.02.21 6
733 [vue storefrontui]외부 API통합하기 참고 문서 총관리자 2022.02.09 7
732 [Cloudera Agent] Metadata-Plugin throttling_logger INFO (713 skipped) Unable to send data to nav server. Will try again. gooper 2022.05.16 7
731 [CDP7.1.7, Hive Replication]Hive Replication진행중 "The following columns have types incompatible with the existing columns in their respective positions " 오류 gooper 2023.12.27 7
730 [CDP7.1.7]Oozie job에서 ERROR: Kudu error(s) reported, first error: Timed out: Failed to write batch of 774 ops to tablet 8003f9a064bf4be5890a178439b2ba91가 발생하면서 쿼리가 실패하는 경우 gooper 2024.01.05 7
729 eclipse editor 설정방법 총관리자 2022.02.01 9
728 주문히스토리 조회 총관리자 2022.04.30 10
727 [bitbucket] 2022년 3월 2일 부터 git 작업시 기존에 사용하던 비빌번호를 사용할 수 없도록 변경되었다. 총관리자 2022.04.30 10
726 oozie의 sqoop action수행시 ooize:launcher의 applicationId를 이용하여 oozie:action의 applicationId및 관련 로그를 찾는 방법 gooper 2023.07.26 10
725 주문 생성 데이터 예시 총관리자 2022.04.30 11
724 [EncryptionZone]User:testuser not allowed to do "DECRYPT_EEK" on 'testkey' gooper 2023.06.29 11
723 [CDP7.1.7]Encryption Zone내부/외부 간 데이터 이동(mv,cp)및 CTAS, INSERT SQL시 오류(can't be moved into an encryption zone, can't be moved from an encryption zone) gooper 2023.11.14 11
722 [CDP7.1.7]impala-shell수행시 간헐적으로 "-k requires a valid kerberos ticket but no valid kerberos ticket found." 오류 gooper 2023.11.16 11
721 [Encryption Zone]Encryption Zone에 생성된 table을 select할때 HDFS /tmp/zone1에 대한 권한이 없는 경우 gooper 2023.06.29 12

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.

위로