ElasticSearch+Kibana 서버 설정 문제 모음

4577 단어 Python 기계 학습
글 목록
1.설치 오류 집계
  • 1.Elasticsearch 는 스 크 립 트 를 입력 하고 실행 할 수 있 기 때문에 시스템 안전 을 위해 루트 를 사용 하여 시작 할 수 없습니다
  • 외부 접근 불가max 가상 메모리 영역 vm.max 해결map_count [65530] is too low, increase to at least [262144]
  • 4. sysctl: setting key "vm.max_map_count": Read-only file system
  • 5. the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

  • 2.kibana 사용 사례데이터 세트
  • 2.맵 설정
  • 데이터 세트 를 불 러 옵 니 다4
  • 4.색인 모드 를 정의 합 니 다
  • Error: FAILED TO PARSE MAPPING [_DOC]: ROOT MAPPING DEFINITION HAS UNSUPPORTED PARAMETERS

  • 1.설치 오류 집계
    1.Elasticsearch 는 스 크 립 트 를 입력 하고 실행 할 수 있 기 때문에 시스템 보안 을 위해 루트 로 시작 할 수 없습니다.
    useradd -m work
    su work
    

    2.외부 접근 불가
    vim elasticsearch.yml
    # ---------------------------------- Network -----------------------------------
    #
    # Set the bind address to a specific IP (IPv4 or IPv6):
    #
    #network.host: 192.168.0.1
    network.host: 0.0.0.0
    #
    # Set a custom port for HTTP:
    #
    http.port: 9200
    #
    # For more information, consult the network module documentation.
    #
    
    

    3.max 가상 메모리 영역 vm.max 해결map_count [65530] is too low, increase to at least [262144]
    //                   
    vi /etc/sysctl.conf 
    
    //        
    vm.max_map_count=655360
    

    저장,그리고:
    sysctl -p
    //-p               ,      /etc/sysctl.conf   
    
    

    오류 알림:
    4. sysctl: setting key “vm.max_map_count”: Read-only file system
    이 는 Docker 의 base image 가 간소화 되 었 고 init 프로 세 스 도 없 었 기 때 문 입 니 다.OS 가 시 작 될 때 시스템 변 수 를 실행 하 는 과정(sysctl-p)도 생략 되 었 기 때문에 이 시스템 변 수 는 kernel 기본 값 을 유지 하고 있 습 니 다.이 럴 때 용기 가 시 작 될 때–privileged 를 추가 하여 시스템 매개 변 수 를 수정 할 수 있 는 권한 을 가 져 와 야 합 니 다.
    여기 서 제 가 선택 한 것 은 숙 성 호스트 자체 의 설정 파일 을 수정 한 다음 에 미 러 를 다시 시작 하 는 것 입 니 다.문 제 를 해결 할 수 있 습 니 다.용 기 를 종료 하고 숙 성 호스트 로 돌아 가 vm.max 를 수정 하 는 것 입 니 다.map_count 는 명령 행 을 통 해 수정 할 수 있 지만 기계 가 다시 시작 할 때 효력 을 잃 기 때문에 설정 파일 을 수정 하여 문 제 를 해결 합 니 다.명령 행 수정 방법:
    sudo sysctl -w vm.max_map_count=655360
    

    5. the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
    elasticsearch.yml  
    
    node.name: node-1    #  
    
    cluster.initial_master_nodes: ["node-1"]          ,               ,    
    
    

    2.kibana 사용 사례
    1.데이터 세트
  • William Shakespeare 의 모든 작품 을 필드 로 적당 하 게 해석 하고 shakespeare.json 을 다운로드 합 니 다
  • 데이터 구조:
    {
        "line_id": INT,
        "play_name": "String",
        "speech_number": INT,
        "line_number": "String",
        "speaker": "String",
        "text_entry": "String",
    }
    

    2.맵 설정
    Kibana Dev Tools>Console 에서 Shakespeare 데이터 세트 에 맵 을 설정 합 니 다.
    PUT /shakespeare
    {
      "mappings": {
        "properties": {
          "doc": {
            "properties": {
              "speaker": {
                "type": "keyword"
              },
              "play_name": {
                "type": "keyword"
              },
              "line_id": {
                "type": "integer"
              },
              "speech_number": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
    
    

    3.데이터 세트 불 러 오기
    curl -H 'Content-Type: application/x-ndjson' -XPOST '49.52.10.203:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json
    

    로 딩 성공 검증:
    GET /_cat/indices?v
    

    4.색인 모드 정의
    Kibana 사용자 가이드(계기판 구축)
    Error: FAILED TO PARSE MAPPING [_DOC]: ROOT MAPPING DEFINITION HAS UNSUPPORTED PARAMETERS
    With Elastic search 7.0 , types were removed and when creating a mapping it no longer accepts types which is a breaking change
    PUT /shakespeare
    {
      "mappings": {
        "properties": {
          "doc": {
            "properties": {
              "speaker": {
                "type": "keyword"
              },
              "play_name": {
                "type": "keyword"
              },
              "line_id": {
                "type": "integer"
              },
              "speech_number": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
    
    

    좋은 웹페이지 즐겨찾기