Edge 구성 방법

설치 후 Edge를 구성하려면 .properties 파일 조합을 사용합니다. 에지 유틸리티가 포함됩니다 예를 들어 Edge UI에서 TLS/SSL을 구성하려면 다음을 수정합니다. .properties 파일을 사용하여 필요한 속성을 설정합니다. 변경사항 파일 .properties개의 경우 영향을 받는 Edge 구성요소를 다시 시작해야 합니다.

Apigee는 .properties 파일을 프로그래밍 방식으로 config (CwC라고도 함)를 사용합니다. 기본적으로 config이 있는 코드는 키/값 조회임 .properties 파일의 설정에 기반한 도구입니다. 구성이 있는 코드에서 키는 토큰 따라서 Edge를 구성하려면 .properties에 토큰을 설정해야 합니다. 할 수 있습니다.

구성이 포함된 코드를 사용하면 Edge 구성요소가 제품을 배포하면 설치팀이 설치 토폴로지에 따라 해당 설정을 재정의할 수 있습니다. 고객이 선택한 속성을 재정의할 수 있습니다.

계층 구조라고 생각한다면 설정은 다음과 같이 배열됩니다. 우선순위가 가장 높은 설정을 선택하여 설치 기사팀의 설정보다 우선 적용되도록 할 수 있습니다. Apigee:

  1. 고객
  2. 설치 프로그램
  3. 구성요소

토큰의 현재 값 확인

.properties 파일에서 토큰에 새 값을 설정하기 전에 먼저 다음 명령어를 사용하여 현재 값을 확인해야 합니다.

/opt/apigee/apigee-service/bin/apigee-service component_name configure -search token

여기서 component_name은 구성요소의 이름이고 token은 토큰입니다. 검사할 수 있습니다

이 명령어는 구성요소의 .properties 파일 계층 구조를 검색하여 토큰의 현재 값을 결정합니다.

다음 예는 conf_http_HTTPRequest.line.limit의 현재 값을 확인합니다. 를 지정합니다.

/opt/apigee/apigee-service/bin/apigee-service edge-router configure -search conf_http_HTTPRequest.line.limit

다음과 비슷한 출력이 표시됩니다.

Found key conf_http_HTTPRequest.line.limit, with value, 4k, in /opt/apigee/edge-router/token/default.properties

토큰의 값이 #로 시작하면 주석 처리되었으며 다음을 사용해야 합니다. 특수 문법을 사용하여 이를 변경할 수 있습니다. 자세한 내용은 현재 주석 처리된 토큰을 설정합니다.

토큰의 전체 이름을 모르는 경우 grep와 같은 도구를 사용하여 검색할 수 있습니다. 자세한 내용은 문서에서 찾기 토큰을 사용합니다.

속성 파일

구성요소 구성 파일에는 수정 가능한 파일과 수정할 수 없는 구성 파일이 있습니다. 이 섹션에서는 할 수 있습니다.

수정 가능한 구성요소 구성 파일

다음 표에는 사용 가능한 Apigee 구성요소와 속성 파일이 나와 있습니다. 해당 구성요소를 구성할 수 있습니다.

구성요소 구성요소 이름 수정 가능한 구성 파일
Cassandra apigee-cassandra /opt/apigee/customer/application/cassandra.properties
에지 라우터 edge-router /opt/apigee/edge-router/conf/load_balancing.properties
Apigee SSO apigee-sso /opt/apigee/customer/application/sso.properties
관리 서버 edge-management-server /opt/apigee/customer/application/management-server.properties
메시지 프로세서 edge-message-processor /opt/apigee/customer/application/message-processor.properties
apigee-monit apigee-monit /opt/apigee/customer/application/monit.properties
기본 UI (새 Edge UI에는 영향을 미치지 않음) edge-ui /opt/apigee/customer/application/ui.properties
Edge UI (새 Edge UI만 해당, 기본 UI에는 영향을 주지 않음) apigee-management-ui 해당 사항 없음 (설치 구성 파일 사용)
OpenLDAP apigee-openldap /opt/apigee/customer/application/openldap.properties
Postgres 서버 edge-postgres-server /opt/apigee/customer/application/postgres-server.properties
PostgreSQL 데이터베이스 apigee-postgresql /opt/apigee/customer/application/postgressql.properties
Qpid 서버 edge-qpid-server /opt/apigee/customer/application/qpid-server.properties
퀴피드 apigee-qpidd /opt/apigee/customer/application/qpidd.properties
라우터 edge-router /opt/apigee/customer/application/router.properties
Zookeeper apigee-zookeeper /opt/apigee/customer/application/zookeeper.properties

이러한 구성요소 구성 파일 중 하나에 속성을 설정하고 싶지만 존재하는 경우 위에 나열된 위치에 만들 수 있습니다.

또한 속성 파일이 'Apigee'의 소유인지 확인해야 합니다. 사용자:

chown apigee:apigee /opt/apigee/customer/application/configuration_file.properties

수정할 수 없는 구성요소 구성 파일

수정할 수 있는 구성요소 구성 파일 외에, 구성 파일도 있습니다. 수정할 수 없습니다.

정보 제공 (수정 불가) 파일에는 다음이 포함됩니다.

소유자 파일 이름 또는 디렉터리
설치
/opt/apigee/token
구성요소
/opt/apigee/component_name/conf

여기서 component_name는 구성요소를 식별합니다. 가능한 값은 다음과 같습니다.

  • apigee-cassandra (Cassandra)
  • apigee-openldap (OpenLDAP)
  • apigee-postgresql (PostgreSQL 데이터베이스)
  • apigee-qpidd (Qpidd)
  • apigee-sso (Edge SSO)
  • apigee-zookeeper (ZooKeeper)
  • edge-management-server (관리 서버)
  • edge-management-ui (새 Edge UI)
  • edge-message-processor (메시지 프로세서)
  • edge-postgres-server (Postgres 서버)
  • edge-qpid-server (Qpid 서버)
  • edge-router (에지 라우터)
  • edge-ui (기본 UI)

토큰 값 설정

다음에서 .properties 파일만 수정할 수 있습니다. /opt/apigee/customer/application 디렉터리 구성요소마다 .properties 파일을 찾습니다. 예: router.propertiesmanagement-server.properties 속성 파일의 전체 목록은 .properties 파일의 위치를 참조하세요.

.properties 파일을 만들려면 다음 안내를 따르세요.

  1. 편집기에서 새 텍스트 파일을 만듭니다. 파일 이름은 위의 표를 참조하세요.
  2. 다음 예시와 같이 파일의 소유자를 'apigee:apigee'로 변경합니다.
    chown apigee:apigee /opt/apigee/customer/application/router.properties

    'Apigee'에서 Edge 서비스를 실행하는 사용자를 변경한 경우 사용자에게 chown: Edge를 실행하는 사용자로 소유권을 변경합니다. 있습니다.

Edge를 업그레이드하면 .properties 파일의 /opt/apigee/customer/application 디렉터리를 읽습니다. 즉, 업그레이드가 수행되면 요소에서 설정한 모든 속성을 그대로 유지합니다.

토큰의 값을 설정하려면 다음 안내를 따르세요.

  1. 구성요소의 .properties 파일을 수정합니다.
  2. 토큰의 값을 추가하거나 변경합니다. 다음 예는 conf_http_HTTPRequest.line.limit 속성을 '10k'로 설정합니다.
    conf_http_HTTPRequest.line.limit=10k

    토큰이 여러 값을 사용하는 경우 다음과 같이 각 값을 쉼표로 구분합니다. 예시:

    conf_security_rbac.restricted.resources=/environments,/environments/*,/environments/*/virtualhosts,/environments/*/virtualhosts/*,/pods,/environments/*/servers,/rebuildindex,/users/*/status,/myuri/*

    이와 같은 목록에 새 값을 추가하려면 일반적으로 새 값을 끝에 추가합니다. 입니다.

  3. 구성요소를 다시 시작합니다.
    /opt/apigee/apigee-service/bin/apigee-service component_name restart

    여기서 component_name은 다음 중 하나입니다.

    • apigee-cassandra (Cassandra)
    • apigee-openldap (OpenLDAP)
    • apigee-postgresql (PostgreSQL 데이터베이스)
    • apigee-qpidd (Qpidd)
    • apigee-sso (Edge SSO)
    • apigee-zookeeper (ZooKeeper)
    • edge-management-server (관리 서버)
    • edge-management-ui (새 Edge UI)
    • edge-message-processor (메시지 프로세서)
    • edge-postgres-server (Postgres 서버)
    • edge-qpid-server (Qpid 서버)
    • edge-router (에지 라우터)
    • edge-ui (기본 UI)

    예를 들어 router.properties를 수정한 후 라우터를 다시 시작합니다.

    /opt/apigee/apigee-service/bin/apigee-service edge-router restart
  4. (선택사항) 토큰 값이 configure -search 옵션. 예를 들면 다음과 같습니다.
    /opt/apigee/apigee-service/bin/apigee-service edge-router configure -search conf_http_HTTPRequest.line.limit

    configure -search에 관한 자세한 내용은 다음을 참고하세요. 토큰의 현재 값을 확인합니다.

토큰 찾기

대부분의 경우 설정해야 하는 토큰은 이 가이드에 명시되어 있습니다. 하지만 전체 이름 또는 위치가 확실하지 않은 기존 토큰의 값을 재정의하려면 grep: 구성요소의 source 디렉터리 검색

예를 들어 이전 버전의 Edge에서 session.maxAge 속성을 사용하고 이 속성을 설정하는 데 사용된 토큰 값을 알고 싶은 경우 이후 /opt/apigee/edge-ui/source의 속성에 대해 grep 디렉터리:

grep -ri "session.maxAge" /opt/apigee/edge-ui/source

다음과 같은 형식으로 결과가 표시됩니다.

/opt/apigee/component_name/source/conf/application.conf:property_name={T}token_name{/T}

다음 예는 UI의 session.maxAge 토큰 값을 보여줍니다.

/opt/apigee/edge-ui/source/conf/application.conf:session.maxAge={T}conf_application_session.maxage{/T}

{T}{/T} 태그 사이의 문자열은 설정할 수 있는 토큰의 이름입니다. UI의 .properties 파일에 있습니다.

현재 주석 처리된 토큰 설정

일부 토큰은 Edge 구성 파일에서 주석 처리됩니다. 특정 키-값 쌍에 대해 설치 또는 구성요소 구성 파일에 주석 처리되어 있으면 설정이 무시됩니다.

Edge 구성 파일에서 주석 처리된 토큰의 값을 설정하려면 특수 구문을 사용합니다

conf/filename+propertyName=propertyValue

예를 들어 Message에 HTTPClient.proxy.host라는 속성을 설정합니다. 프로세서, 첫 번째 grep 속성 값으로 토큰을 결정합니다.

grep -ri /opt/apigee/edge-message-processor/ -e "HTTPClient.proxy.host"

grep 명령어는 토큰 이름이 포함된 결과를 반환합니다. 알림 # 접두사로 표시된 대로 속성 이름이 주석 처리되는 방식은 다음과 같습니다.

source/conf/http.properties:#HTTPClient.proxy.host={T}conf_http_HTTPClient.proxy.host{/T}
token/default.properties:conf_http_HTTPClient.proxy.host=
conf/http.properties:#HTTPClient.proxy.host=

이 속성의 값을 설정하려면 /opt/apigee/customer/application/message-processor.properties이지만 특수 구문을 사용합니다.

conf/http.properties+HTTPClient.proxy.host=myhost.name.com

이 경우 속성 이름 앞에 conf/http.properties+ 접두사를 붙여야 합니다. 이 은 속성 뒤에 '+'를 포함하는 구성 파일의 위치와 이름입니다.

메시지 프로세서를 다시 시작한 후 파일 검사 /opt/apigee/edge-message-processor/conf/http.properties:

cat /opt/apigee/edge-message-processor/conf/http.properties

파일 끝에 다음 형식으로 속성 집합이 표시됩니다.

conf/http.properties:HTTPClient.proxy.host=myhost.name.com

Trace UI의 요청 보내기 섹션에서 요청에 대한 전달 프록시 구성

이 섹션에서는 선택사항인 프록시 사용자 인증 정보를 사용하여 Trace UI의 요청 보내기 섹션입니다. 전달 프록시를 구성하려면 다음 단계를 따르세요.

  1. /opt/apigee/customer/application/ui.properties를 수정하고 파일이 다음과 같은지 확인합니다. 소유자: apigee:apigee
  2. 다음 재정의 (특정 프록시 구성에 대한 값 변경)를 추가합니다.
    conf_application_http.proxyhost=proxy.example.com
    conf_application_http.proxyport=8080
    conf_application_http.proxyuser=apigee
    conf_application_http.proxypassword=Apigee123!
  3. 저장 후 기본 UI를 다시 시작합니다.

Apigee Router/Nginx에 커스텀 로그 형식 추가

경우에 따라 기본 Apigee Router/Nginx 로그 형식을 변경하거나 변수를 추가합니다. 기본 Apigee Router/Nginx 로그 형식 업데이트 구성:

  1. router.properties 파일이 없으면 아래와 같은 경로를 사용하여 만듭니다.
    /opt/apigee/customer/application/router.properties
  2. router.properties 파일에 다음 콘텐츠를 추가합니다. 다음 이름으로 새 log_format 구성을 만듭니다. router_new:
    conf_load_balancing_load.balancing.driver.nginx.global.http.parameters.template.extra=log_format router_new 'time_iso8601\\\\thostname\\\\tremote_addr:remote_port\\\\t'\\\\n\\n 'upstream_addr\\\\trequest_time\\\\t-\\\\t-\\\\t'\\\\n\\n 'status\\\\tupstream_status\\\\trequest_length\\\\t'\\\\n\\n 'body_bytes_sent\\\\t'\\\\n\\n 'request\\\\tupstream_http_x_apigee_message_id\\\\t'\\\\n\\n 'http_user_agent\\\\thost\\thostname-pid-connection-connection_requests\\\\tmy_nginx_var_xff\\t'\\\\n\\n 'upstream_http_x_apigee_fault_flag\\\\tupstream_http_x_apigee_fault_source\\\\tupstream_http_x_apigee_fault_code\\\\t'\\\\n\\n 'upstream_http_x_apigee_fault_policy\\tupstream_http_x_apigee_fault_flow\\tupstream_http_x_apigee_fault_revision\\t'\\\\n\\n 'upstream_http_x_apigee_dp_color\\\\tmy_x_apigee_target_latency\\\\t'\\\\n\\n 'upstream_http_x_apigee_proxy\\\\tupstream_http_x_apigee_proxy_basepath\\\\t'\\\\n\\n 'self_region\\\\tself_pod\\\\tself_color\\\\tssl_protocol\\\\tssl_client_verify\\\\tssl_session_id\\\\tssl_session_reused\\\\tupstream_pod\\\\tupstream_region';\\\\n\\n\n
    conf_load_balancing_load.balancing.driver.nginx.access.log={conf_load_balancing_load.balancing.driver.nginx.log.dir}/{org}~{env}.{port}_access_log router_new

    위 명령어의 변수를 적절하게 업데이트합니다. 기본값은 아래 파일에서 log_format의 구성 값을 확인하세요.

    /opt/apigee/edge-router/conf/load_balancing.properties

    Nginx 변수 목록은 http://nginx.org/en/docs/varindex.html에 표시됩니다.

  3. 라우터를 다시 시작하여 새 구성을 적용합니다.
    apigee-service edge-router restart
  4. log_format 구성이 있는지 확인합니다. (router_new)(이)가 파일에 추가되었습니다. /opt/nginx/conf.d/0-default.conf:
        
    cat /opt/nginx/conf.d/0-default.conf | grep router_new -A 10
  5. API 프록시에 일부 API 요청을 전송하고 파일의 새 로그 형식을 확인합니다.
    /opt/apigee/var/log/edge-router/nginx/${org}~${env}.${port}_access_log file