설치 후 Edge를 구성하려면 .properties 파일
과 Edge 유틸리티를 함께 사용합니다. 예를 들어 새 Edge UI에서 TLS/SSL을 구성하려면
.properties 파일을 수정하여 필요한 속성을 설정합니다.
.properties 파일을 변경하려면 영향을 받는 Edge 구성요소를 다시 시작해야 합니다.
Apigee는 .properties 파일을 수정하는 기법을 구성으로
코드 작성 (CwC라고도 함)이라고 합니다. 기본적으로 구성으로 코드 작성은 키/값 조회
도구이며, .properties 파일의 설정을 기반으로 합니다. 구성으로 코드 작성에서 키는
토큰이라고 합니다. 따라서 Edge를 구성하려면 .properties
파일에서 토큰을 설정합니다.
구성으로 코드 작성을 사용하면 Edge 구성요소가 제품과 함께 제공되는 기본값을 설정하고, 설치팀이 설치 토폴로지에 따라 이러한 설정을 재정의한 후 고객이 선택한 속성을 재정의할 수 있습니다.
계층 구조로 생각하면 설정은 다음과 같이 정렬되며 고객 설정이 설치팀 또는 Apigee의 설정을 재정의하는 데 가장 높은 우선순위를 갖습니다.
- 고객
- 설치 프로그램
- 구성요소
토큰의 현재 값 확인
.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-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 |
| 새 Edge UI | edge-management-ui |
/opt/apigee/customer/application/management-ui.properties |
| 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/postgresql.properties |
| Qpid 서버 | edge-qpid-server |
/opt/apigee/customer/application/qpid-server.properties |
| Qpidd | 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은 구성요소를 식별합니다. 가능한 값은 다음과 같습니다.
|
토큰 값 설정
/opt/apigee/customer/application 디렉터리의 .properties 파일만 수정할 수 있습니다. 각 구성요소에는 해당 디렉터리에 자체
.properties 파일이 있습니다. 예를 들어 router.properties
및 management-server.properties입니다. 속성 파일의 전체 목록은
.properties 파일의 위치를 참고하세요.
.properties 파일을 만들려면 다음 단계를 따르세요:
- 편집기에서 새 텍스트 파일을 만듭니다. 파일 이름은 위의 표에 표시된 고객 파일 목록과 일치해야 합니다.
- 다음 예시와 같이 파일의 소유자를 'apigee:apigee'로 변경합니다.
chown apigee:apigee /opt/apigee/customer/application/router.properties
Edge 서비스를 실행하는 사용자를 "apigee" 사용자에서 변경한 경우
chown을 사용하여 소유권을 Edge 서비스를 실행하는 사용자로 변경합니다.
Edge를 업그레이드하면 .properties 파일이
/opt/apigee/customer/application 디렉터리에서 읽힙니다. 즉, 업그레이드 시 구성요소에 설정한 속성이 유지됩니다.
토큰의 값을 설정하려면 다음 단계를 따르세요.
- 구성요소의
.properties파일을 수정합니다. - 토큰의 값을 추가하거나 변경합니다. 다음 예시에서는
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/*
이와 같은 목록에 새 값을 추가하려면 일반적으로 목록 끝에 새 값을 추가합니다.
- 구성요소를 다시 시작합니다.
/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-zookeeper(ZooKeeper)edge-management-server(관리 서버)edge-management-ui(새 Edge UI)edge-message-processor(메시지 프로세서)edge-postgres-server(Postgres 서버)edge-qpid-server(Qpid 서버)edge-router(에지 라우터)
예를 들어
router.properties를 수정한 후 라우터를 다시 시작합니다./opt/apigee/apigee-service/bin/apigee-service edge-router restart
- (선택사항)
configure -search옵션을 사용하여 토큰 값이 새 값으로 설정되었는지 확인합니다. 예를 들면 다음과 같습니다./opt/apigee/apigee-service/bin/apigee-service edge-router configure -search conf_http_HTTPRequest.line.limit
configure -search에 대한 자세한 내용은 토큰의 현재 값 확인을 참고하세요.
토큰 찾기
대부분의 경우 설정해야 하는 토큰은 이 가이드에 나와 있습니다. 하지만 전체 이름이나 위치를 잘 모르는 기존 토큰의 값을 재정의해야 하는 경우 grep을 사용하여 구성요소의 source 디렉터리를 검색합니다.
예를 들어
HTTPRequest.line.limit 속성을 설정하고 이를 설정하는 데 사용되는 토큰 값을 알고 싶다면
grep 디렉터리에서 속성을 /opt/apigee/edge-management-server/source
합니다.
grep -ri "HTTPRequest.line.limit" /opt/apigee/edge-management-server/source
다음과 같은 결과가 표시됩니다.
/opt/apigee/component_name/source/conf/http.properties:property_name={T}token_name{/T}다음 예시에서는 관리 서버의 HTTPRequest.line.limit 토큰 값을 보여줍니다.
/opt/apigee/edge-management-server/source/conf/http.properties:HTTPRequest.line.limit={T}conf_http_HTTPRequest.line.limit{/T}{T}{/T} 태그 사이의 문자열은 구성요소의 .properties 파일에서 설정할 수 있는 토큰의 이름입니다.
현재 주석 처리된 토큰 설정
일부 토큰은 Edge 구성 파일에서 주석 처리됩니다. 설치 또는 구성요소 구성 파일에서 주석 처리된 토큰을 설정하려고 하면 설정이 무시됩니다.
Edge 구성 파일에서 주석 처리된 토큰의 값을 설정하려면 다음 형식의 특수 구문을 사용합니다.
conf/filename+propertyName=propertyValue
예를 들어 메시지
프로세서에서 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
새 Edge UI에서 HTTP/2 프로토콜 사용 설정 또는 중지
이 섹션에서는 새 Edge UI (edge-management-ui)에서 HTTP/2 프로토콜을 사용 설정 또는 중지하는 방법을 설명합니다.
/opt/apigee/customer/application/management-ui.properties를 만들거나 수정하고 파일의 소유자가apigee:apigee인지 확인합니다.- HTTP/2 프로토콜을 사용 설정 또는 중지하려면 다음 재정의를 추가합니다.
conf_uebe_disable_http2={true or false} - 새 Edge UI (
edge-management-ui)를 저장하고 다시 시작합니다.
Apigee 라우터/Nginx에 커스텀 로그 형식 추가
경우에 따라 기본 Apigee 라우터/Nginx 로그 형식을 변경하거나 변수를 추가해야 할 수 있습니다. 기본 Apigee 라우터/Nginx 로그 형식 구성을 업데이트하려면 다음 단계를 따르세요.
- 아래 표시된 경로로
router.properties파일이 없는 경우 만듭니다./opt/apigee/customer/application/router.properties
router.properties파일에 다음 콘텐츠를 추가하여 이름이router_new인 새log_format구성을 만듭니다.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에 표시됩니다.
- 라우터를 다시 시작하여 새 구성을 적용합니다.
apigee-service edge-router restart
- 새
log_format구성 (router_new)이 파일/opt/nginx/conf.d/0-default.conf에 추가되었는지 확인합니다.cat /opt/nginx/conf.d/0-default.conf | grep router_new -A 10
- API 프록시에 API 요청을 보내고 파일에서 새 로그 형식을 확인합니다.
/opt/apigee/var/log/edge-router/nginx/${org}~${env}.${port}_access_log file