Edge の構成方法

インストール後に Edge を構成するには、.properties ファイルを組み合わせて使用します。 ユーティリティです。たとえば、Edge UI で TLS/SSL を構成するには、 .properties ファイルを使用して、必要なプロパティを設定します。変更点 .properties 個のファイルで、影響を受ける Edge コンポーネントを再起動する必要があります。

Apigee では、.properties ファイルを編集する手法のことを、 config(CwC と略されることもあります)。基本的に、構成のあるコードは Key-Value ルックアップです。 .properties ファイルの設定に基づいて作成されます。config を含むコードでは、キーは「 トークンを使用します。したがって、Edge を構成するには、.properties にトークンを設定します。 できます。

config with config を実行すると、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
Apigee SSO apigee-sso /opt/apigee/customer/application/sso.properties
管理サーバー edge-management-server /opt/apigee/customer/application/management-server.properties
Message Processor edge-message-processor /opt/apigee/customer/application/message-processor.properties
apigee-monit apigee-monit /opt/apigee/customer/application/monit.properties
Classic UI(新しい Edge UI には影響しません) edge-ui /opt/apigee/customer/application/ui.properties
Edge UI(新しい Edge UI のみ。Classic 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/postgresql.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」にする必要があります。user:

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(Management Server)
  • edge-management-ui(新しい Edge UI)
  • edge-message-processor(Message Processor)
  • edge-postgres-server(Postgres Server)
  • edge-qpid-server(Qpid Server)
  • edge-router(Edge Router)
  • edge-ui(Classic UI)

トークン値を設定する

変更できるのは .properties ファイルのみです。 /opt/apigee/customer/application ディレクトリ。コンポーネントにはそれぞれ固有の そのディレクトリにある .properties ファイルを確認します。例: router.properties および management-server.properties。プロパティ ファイルの完全なリストについては、 .properties ファイルの場所をご覧ください。

.properties ファイルを作成するには:

  1. エディタで新しいテキスト ファイルを作成します。ファイル名は、 お客様のファイルの上記の表をご覧ください。
  2. 次の例のように、ファイルの所有者を「apigee:apigee」に変更します。
    chown apigee:apigee /opt/apigee/customer/application/router.properties

    Edge サービスを実行するユーザーを「apigee」から使用する場合は、 chown: Edge を実行しているユーザーにオーナー権限を変更します。 あります。

Edge をアップグレードすると、.properties /opt/apigee/customer/application ディレクトリが読み取られます。つまり、アップグレードは コンポーネントに設定したプロパティは保持されます。

トークンの値を設定するには:

  1. コンポーネントの .properties ファイルを編集します。
  2. トークンの値を追加または変更します。次の例では、Pod の 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(Management Server)
    • edge-management-ui(新しい Edge UI)
    • edge-message-processor(Message Processor)
    • edge-postgres-server(Postgres Server)
    • edge-qpid-server(Qpid Server)
    • edge-router(Edge Router)
    • edge-ui(Classic UI)

    たとえば、router.properties を編集した後、Router を再起動します。

    /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 構成ファイルでは、一部のトークンがコメントアウトされています。トークンを外部 IP アドレスに がインストール構成ファイルまたはコンポーネント構成ファイルでコメントアウトされている場合、その設定は無視されます。

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+ を付ける必要があります。この プロパティを含む構成ファイルの場所と名前の後に「+」を付けたものです。

Message Processor を再起動した後、ファイルを調べて /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 の [Send Requests] セクションからのリクエスト用に転送プロキシを構成する

このセクションでは、送信元のリクエストに対して転送プロキシを構成する方法について説明します。 Trace UI の [Send Requests] セクションとオプションのプロキシ認証情報。 転送プロキシを構成するには:

  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. Router を再起動して新しい構成を適用します。
    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