ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Cassandra Cluster 3.x Installation
    Infra 2023. 4. 22. 16:53
    1. 여기에서 다운로드 받아서 설치함 https://dlcdn.apache.org/cassandra/3.11.14/apache-cassandra-3.11.14-bin.tar.gz
    2. jdk는 1.8을 설치함
    3. cassandra.yaml을 변경함 (chatgpt에게 질문했고, 아래와 같이 답변을 얻음) 아래의 key 값들만 변경하면 클러스터 동작함
    cluster_name: 'testcluster'
    data_file_directories:
        - /home/user1/data/cassandra/data
    commitlog_directory: /home/user1/data/cassandra/commitlog
    seed_provider:
        # Addresses of hosts that are deemed contact points. 
        # Cassandra nodes use this list of hosts to find each other and learn
        # the topology of the ring.  You must change this if you are running
        # multiple nodes!
        - class_name: org.apache.cassandra.locator.SimpleSeedProvider
          parameters:
              # seeds is actually a comma-delimited list of addresses.
              # Ex: "<ip1>,<ip2>,<ip3>"
              - seeds: "192.168.10.1,192.168.10.2,192.168.10.3"
    listen_address: 192.168.10.1
    rpc_address: 0.0.0.0
    broadcast_rpc_address: 192.168.10.1
    endpoint_snitch: GossipingPropertyFileSnitch

    4. .bashrc에 CASSANDRA_HOME을 설정한다.

    export CASSANDRA_HOME=/home/deploy/apps/cassandra
    export PATH=$PATH:$CASSANDRA_HOME/bin

    5. 다음과 같이 cassandra를 시작하고, 노드의 상태를 확인한다.

    // 카산드라를 실행한다.
    /home/user1/apps/cassandra/bin/cassandra
    
    // 3개의 노드를 모두 구동한 후에 상태를 확인한다.
    ./nodetool status
    
    Datacenter: dc1
    ===============
    Status=Up/Down
    |/ State=Normal/Leaving/Joining/Moving
    --  Address         Load       Tokens  Owns (effective)  Host ID                          Rack
    UN  192.168.10.1  164.49 KiB  256     68.7%        a75ff040-f2ff-4ebd-8ce1-a406689dd1b6  rack1
    UN  192.168.10.2  153.06 KiB  256     68.5%        a8929806-ce38-49e1-8286-98343fed2136  rack1
    UN  192.168.10.3  152.51 KiB  256     62.9%        91248706-5242-452d-bd24-dd5e39acbc1c  rack1

    'Infra' 카테고리의 다른 글

    Jenkins build 강제종료 방법  (0) 2023.05.28
    Ubuntu 자동실행 스크립트 만들기  (0) 2023.05.01
Designed by Tistory.