This documentation is for older WSO2 products. View documentation for the latest release.
Page Comparison - Clustering API Manager (v.125 vs v.126) - Clustering Guide 4.2.0 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added a note on Session Affinity

...

You will now configure the inter-component relationships illustrated in the following diagram by modifying their <APIM_HOME>/repository/conf/api-manager.xml files.

Note

In a clustered environment, you use Session Affinity to ensure that requests from the same client always get routed to the same server.
It is mandatory to set up Session Affinity in the Load Balancers when it is fronting the Publisher and Store clusters and it is not mandatory when configuring a Key Manager cluster with a Load Balancer. However, authentication via session ID fails when Session Affinity is disabled in the Load Balancer.
The Key Manager first tries to authenticate the request via the session ID. If it fails, the Key Manager tries to authenticate via basic authentication.


  1. Open the <APIM_HOME>/repository/conf/api-manager.xml files in the Gateway, Publisher, Key Manager and Store components.
  2. Modify each of the files as follows:
    • Key Manager

      Localtab Group
      Localtab
      activetrue
      titleAPI Manager 1.9.0
      Code Block
      <APIGateway>
      	<Environments>
      		<Environment type="hybrid">
      		...
      			<ServerURL>https://<IP of the Gateway>:9443/services/</ServerURL>
      			<Username>admin</Username>
      			<Password>admin</Password> 
      			<GatewayEndpoint>http://<IP of the Gateway>:8280,https://<IP of the Gateway>:8243</GatewayEndpoint>
      		</Environment>
      	</Environments> 
      ...
      </APIGateway>
      Localtab
      titleAPI Manager 1.8.0 and 1.7.0

      Configure the <RevokeAPIURL> element in the api-manager.xml file by providing the URL of the Revoke API that is deployed in the API Gateway node.

      Code Block
      <RevokeAPIURL>https://${carbon.local.ip}:${https.nio.port}/revoke</RevokeAPIURL>
      ...
      <APIGateway>
      	<Environments>
      		<Environment type="hybrid">
      		...
      			<ServerURL>https://<IP of the Gateway>:9443/services/</ServerURL>
      			<Username>admin</Username>
      			<Password>admin</Password> 
      			<GatewayEndpoint>http://<IP of the Gateway>:8280,https://<IP of the Gateway>:8243</GatewayEndpoint>
      		</Environment>
      	</Environments> 
      ...
      </APIGateway>
      Localtab
      titleAPI Manager 1.6.0 and 1.5.0

      No changes required in the Key Manager node.

    • Gateway: configure the connection to the Key Manager component as follows:

      Localtab Group
      Localtab
      activetrue
      titleAPI Manager 1.9.0
      Code Block
      languagenone
      <APIKeyValidator> 
        <ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
        <Username>admin</Username>
        <Password>admin</Password>
        ...
      </APIKeyValidator>
      Localtab
      titleAPI Manager 1.8.0, 1.7.0, 1.6.0 and 1.5.0
      Code Block
      languagenone
      <APIKeyManager> 
        <ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
        <Username>admin</Username>
        <Password>admin</Password>
        ...
      </APIKeyManager>
      
    • Publisher: configure connections to the Key Manager and Gateway as follows:

      Localtab Group
      Localtab
      activetrue
      titleAPI Manager 1.9.0
      Code Block
      languagenone
      <APIKeyValidator>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      ...
      </APIKeyValidator>
      
      
      <AuthManager>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      </AuthManager>
      
      
      <APIGateway>
      	<Environments>
      		<Environment type="hybrid">
      		...
      			<ServerURL>https://<IP of the Gateway>:9443/services/</ServerURL>
      			<Username>admin</Username>
      			<Password>admin</Password> 
      			<GatewayEndpoint>https://<IP of the Gateway>:8280,https://<IP of the Gateway>:8243</GatewayEndpoint>
      		</Environment>
      	</Environments> 
      ...
      </APIGateway>
      Localtab
      titleAPI Manager 1.8.0, 1.7.0, 1.6.0 and 1.5.0

      Configure the <RevokeAPIURL> element in the api-manager.xml file by providing the URL of the Revoke API that is deployed in the API Gateway node.

      Code Block
      languagenone
      <APIKeyManager>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      ...
      </APIKeyManager>
      
      
      <AuthManager>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      </AuthManager>
      
      
      <APIGateway>
      	<Environments>
      		<Environment type="hybrid">
      		...
      			<ServerURL>https://<IP of the Gateway>:9443/services/</ServerURL>
      			<Username>admin</Username>
      			<Password>admin</Password> 
      			<GatewayEndpoint>https://<IP of the Gateway>:8280,https://<IP of the Gateway>:8243</GatewayEndpoint>
      		</Environment>
      	</Environments> 
      ...
      </APIGateway>
      Info

      Creating a connection to the Key Manager from the Publisher is required in API Manager 1.3.0 but is no longer required from API Manager 1.4.0 onwards.

    • Store

      Localtab Group
      Localtab
      activetrue
      titleAPI Manager 1.9.0
      Code Block
      languagenone
      <RevokeAPIURL>https://<IP of the Gateway>:8243/revoke</RevokeAPIURL>
       
       
      <APIKeyValidator>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      ...
      </APIKeyValidator>
      
      
      <AuthManager>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      </AuthManager>
      
      
      <APIGateway>
      	<Environments>
      		<Environment type="hybrid">
      		...
      			<ServerURL>https://<IP of the Gateway>:9443/services/</ServerURL>
      			<Username>admin</Username>
      			<Password>admin</Password> 
      			<GatewayEndpoint>https://<IP of the Gateway>:8280,https://<IP of the Gateway>:8243</GatewayEndpoint>
      		</Environment>
      	</Environments> 
      ...
      </APIGateway>
      Localtab
      titleAPI Manager 1.8.0, 1.7.0, 1.6.0 and 1.5.0
      Code Block
      languagenone
      <APIKeyManager>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      ...
      </APIKeyManager>
      
      
      <AuthManager>
      	<ServerURL>https://<IP of the Key Manager>:9443/services/</ServerURL>
      	<Username>admin</Username>
      	<Password>admin</Password>
      </AuthManager>
      
      
      <APIGateway>
      	<Environments>
      		<Environment type="hybrid">
      		...
      			<ServerURL>https://<IP of the Gateway>:9443/services/</ServerURL>
      			<Username>admin</Username>
      			<Password>admin</Password> 
      			<GatewayEndpoint>https://<IP of the Gateway>:8280,https://<IP of the Gateway>:8243</GatewayEndpoint>
      		</Environment>
      	</Environments> 
      ...
      </APIGateway>
      Tip

      Tip: For more information on how different environment types, see Maintaining Separate Production and Sandbox Gateways. This is useful when configuring environments in different geographical locations.

...