Linux x86_64 에서 ZooKeeper 데이터 저장소 생성하기

ZooKeeper 운영자를 설치하고 데이터 저장소를 설정하십시오.

참고: Instana 를 처음 설치할 때는 Zookeeper 대신 Clickhouse-keeper를 사용하십시오.

ZooKeeper 배포용 운영체제 버전 및 이미지 태그

고정된 Helm 차트 또는 운영자 버전에는 다음 이미지가 필요합니다.

표 1.ZooKeeper 운영자 버전 및 이미지 태그
플랫폼 오퍼레이터 버전 Helm 차트 버전 태그가 있는 이미지
Linux® x86_64 0.2.15 1.0.0 artifact-public.instana.io/self-hosted-images/3rd-party/operator/zookeeper: 0.2.15_v0.21.0 artifact-public.instana.io/self-hosted-images/3rd-party/datastore/zookeeper: 3.9.3_v0.21.0 artifact-public.instana.io/self-hosted-images/k8s/ kubectl : v1.35.2_v0.11.0

ZooKeeper 온라인 설치

ZooKeeper 데이터 저장소를 설치하려면 다음 단계를 완료하십시오.

  1. instana-zookeeper 네임스페이스를 작성하십시오.

    kubectl create namespace instana-zookeeper
     
  2. instana-zookeeper 네임스페이스에 대한 이미지 풀 시크릿을 작성하십시오. 사용자 고유의 다운로드 키를 사용하여 <download_key> 값을 업데이트하십시오.

    kubectl create secret docker-registry instana-registry --namespace instana-zookeeper \
      --docker-username=_ \
      --docker-password=<download_key> \
      --docker-server=artifact-public.instana.io
     
  3. ZooKeeper 운영자를 설치하십시오.

    helm install zookeeper-operator -n instana-zookeeper instana/zookeeper-operator --create-namespace --version=1.0.0 --set image.repository=artifact-public.instana.io/self-hosted-images/3rd-party/operator/zookeeper --set image.tag=0.2.15_v0.21.0 --set global.imagePullSecrets={"instana-registry"}
     
  4. ZooKeeper 인스턴스를 설치하려면 instana-clickhouse 네임스페이스가 필요합니다. instana-clickhouse 네임스페이스가 클러스터에 있는지 확인하십시오. 존재하지 않는 경우 지금 만들 수 있습니다.

    1. instana-clickhouse 네임스페이스가 있는지 확인하십시오.
      kubectl get namespace | grep clickhouse
       
    2. instana-clickhouse 네임스페이스가 없는 경우 지금 작성하십시오.
      kubectl create namespace instana-clickhouse
       
  5. instana-clickhouse 네임스페이스에 대한 이미지 풀 시크릿을 작성하십시오. 시크릿을 작성하기 전에 < download_key>값을 에이전트 키로 업데이트하십시오.

    kubectl create secret docker-registry instana-registry \
      --namespace=instana-clickhouse \
      --docker-username=_ \
      --docker-password=<download_key> \
      --docker-server=artifact-public.instana.io
     
  6. YAML 파일을 생성하고, 예를 들어 zookeeper.yaml다음과 같은 ZooKeeper 구성을 포함시킵니다:

    apiVersion: "zookeeper.pravega.io/v1beta1"
    kind: "ZookeeperCluster"
    metadata:
      name: "instana-zookeeper"
    spec:
      # For parameters and default values, see https://github.com/pravega/zookeeper-operator/tree/master/charts/zookeeper#configuration
      replicas: 3
      image:
        repository: artifact-public.instana.io/self-hosted-images/3rd-party/datastore/zookeeper
        tag: 3.9.3_v0.15.0
      pod:
        imagePullSecrets: [name: "instana-registry"]
        # Add the following Affinity snippet to schedule each pod on a different node. 
        # affinity:
        #   podAntiAffinity:
        #     requiredDuringSchedulingIgnoredDuringExecution:
        #       - labelSelector:
        #           matchExpressions:
        #             - key: kind
        #               operator: In
        #               values:
        #                 - "ZookeeperMember"
        #         topologyKey: kubernetes.io/hostname
        serviceAccountName: "zookeeper"
        # Add the following securityContext snippet for Kubernetes offerings other than OCP.
        # securityContext:
        #   runAsUser: 1000
        #   fsGroup: 1000
      config:
        tickTime: 2000
        initLimit: 10
        syncLimit: 5
        maxClientCnxns: 0
        autoPurgeSnapRetainCount: 20
        autoPurgePurgeInterval: 1
      persistence:
        reclaimPolicy: Delete
        spec:
          resources:
            requests:
              storage: "10Gi"
     
  7. ZooKeeper (온라인 및 오프라인)의 단계를 완료하십시오.

ZooKeeper 오프라인 설치

설치 준비시 외부 레지스트리에서 ZooKeeper 이미지를 아직 가져오지 않은 경우 지금 가져올 수 있습니다. bastion 호스트에서 다음 명령을 실행하십시오. 그런 다음, 해당 이미지를 에어갭 환경에 있는 Instana 호스트로 복사하십시오.

docker pull artifact-public.instana.io/self-hosted-images/3rd-party/operator/zookeeper:0.2.15_v0.21.0
docker pull artifact-public.instana.io/self-hosted-images/3rd-party/datastore/zookeeper:3.9.3_v0.21.0
docker pull artifact-public.instana.io/self-hosted-images/k8s/kubectl:v1.35.2_v0.11.0
         

Instana 호스트에서 다음 단계를 수행하십시오.

  1. 이미지를 내부 이미지 레지스트리에 다시 태그 지정하십시오.

    docker tag artifact-public.instana.io/self-hosted-images/3rd-party/operator/zookeeper:0.2.15_v0.21.0 <internal-image-registry>/operator/zookeeper:0.2.15_v0.21.0
    docker tag artifact-public.instana.io/self-hosted-images/3rd-party/datastore/zookeeper:3.9.3_v0.21.0 <internal-image-registry>/zookeeper:3.9.3_v0.21.0
    docker tag artifact-public.instana.io/self-hosted-images/k8s/kubectl:v1.35.2_v0.11.0 <internal-image-registry>/self-hosted-images/k8s/kubectl:v1.35.2_v0.11.0
                   
  2. 배스천 호스트의 내부 이미지 레지스트리에 이미지를 푸시하십시오.

    docker push <internal-image-registry>/operator/zookeeper:0.2.15_v0.21.0
    docker push <internal-image-registry>/zookeeper:3.9.3_v0.21.0
    docker push <internal-image-registry>/self-hosted-images/k8s/kubectl:v1.35.2_v0.11.0
                   
  3. instana-zookeeper 네임스페이스를 작성하십시오.

    kubectl create namespace instana-zookeeper
     
  4. 선택 사항입니다: 내부 이미지 레지스트리에 인증이 필요한 경우 이미지 풀 시크릿을 생성합니다.

    kubectl create secret docker-registry <secret_name> --namespace instana-zookeeper \
    --docker-username=<registry_username> \
    --docker-password=<registry_password> \
    --docker-server=<internal-image-registry>:<internal-image-registry-port> \
    --docker-email=<registry_email>
     
  5. ZooKeeper 운영자를 설치하십시오. 이전 단계에서 이미지 풀 시크릿을 만든 경우 다음 명령에 --set imagePullSecrets[0].name="<internal-image-registry-pull-secret>"을 추가합니다.

    helm install zookeeper-operator -n instana-zookeeper zookeeper-operator-1.0.0.tgz --version=1.0.0 --set image.repository=<internal-image-registry>/operator/zookeeper --set image.tag=0.2.15_v0.21.0 --set hooks.image.repository=<internal-image-registry>/self-hosted-images/k8s/kubectl --set hooks.image.tag=v1.35.2_v0.11.0
                   
  6. ZooKeeper 인스턴스를 설치하려면 instana-clickhouse 네임스페이스가 필요합니다. instana-clickhouse 네임스페이스가 클러스터에 있는지 확인하십시오. 존재하지 않는 경우 지금 만들 수 있습니다.

    1. instana-clickhouse 네임스페이스가 있는지 확인하십시오.
      kubectl get namespace | grep clickhouse
       
    2. instana-clickhouse 네임스페이스가 없는 경우 지금 작성하십시오.
      kubectl create namespace instana-clickhouse
       
  7. YAML 파일을 생성하고, 예를 들어 zookeeper.yaml다음과 같은 ZooKeeper 구성을 포함시킵니다:

    apiVersion: "zookeeper.pravega.io/v1beta1"
    kind: "ZookeeperCluster"
    metadata:
      name: "instana-zookeeper"
    spec:
      # For parameters and default values, see https://github.com/pravega/zookeeper-operator/tree/master/charts/zookeeper#configuration
      replicas: 3
      image:
        repository: <internal-image-registry>/zookeeper
        tag: 3.9.3_v0.16.0
      pod:
        imagePullSecrets: [name: "<internal-registry-secret>"]
        # Add the following Affinity snippet to schedule each pod on a different node. 
        # affinity:
        #   podAntiAffinity:
        #     requiredDuringSchedulingIgnoredDuringExecution:
        #       - labelSelector:
        #           matchExpressions:
        #             - key: kind
        #               operator: In
        #               values:
        #                 - "ZookeeperMember"
        #         topologyKey: kubernetes.io/hostname
        serviceAccountName: "zookeeper"
        # Add the following securityContext snippet for Kubernetes offerings other than OCP.
        # securityContext:
        #   runAsUser: 1000
        #   fsGroup: 1000
      config:
        tickTime: 2000
        initLimit: 10
        syncLimit: 5
        maxClientCnxns: 0
        autoPurgeSnapRetainCount: 20
        autoPurgePurgeInterval: 1
      persistence:
        reclaimPolicy: Delete
        spec:
          resources:
            requests:
              storage: "10Gi"
     
  8. ZooKeeper (온라인 및 오프라인)의 단계를 완료하십시오.

ZooKeeper 배포 및 검증 (온라인 및 오프라인)

ZooKeeper 인스턴스를 배치하고 데이터 저장소를 작성하려면 다음 단계를 완료하십시오.

  1. ZooKeeper를 배치하십시오.

    kubectl apply -f zookeeper.yaml -n instana-clickhouse
     

    ClickHouse 는 전용 ZooKeeper 클러스터가 필요하므로 ZooKeeper 가 instana-clickhouse 네임스페이스에 설치됩니다.

  2. ZooKeeper 운영자 팟 (Pod) 이 실행 중인지 확인하십시오.

    kubectl get pods -n instana-zookeeper
     

    샘플 출력:

    NAME                                          READY   STATUS    RESTARTS   AGE
    instana-zookeeper-operator-7fccd8fd77-9lww5   1/1     Running   0          74s
     

    ZooKeeper 가 작동 중인지 확인하십시오.

    kubectl get all -n instana-clickhouse
     

    다음 샘플 출력을 참조하십시오.

    NAME                      READY   STATUS    RESTARTS   AGE
    pod/instana-zookeeper-0   1/1     Running   0          119s
    pod/instana-zookeeper-1   1/1     Running   0          82s
    pod/instana-zookeeper-2   1/1     Running   0          47s
    
    NAME                                     TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                                        AGE
    service/instana-zookeeper-admin-server   ClusterIP   192.168.1.126   <none>        8080/TCP                                       2m
    service/instana-zookeeper-client         ClusterIP   192.168.1.13    <none>        2181/TCP                                       2m
    service/instana-zookeeper-headless       ClusterIP   None            <none>        2181/TCP,2888/TCP,3888/TCP,7000/TCP,8080/TCP   2m
    
    NAME                                 READY   AGE
    statefulset.apps/instana-zookeeper   3/3     2m3s