Error while configuring multiple Microgateways within Same Org

Not applicable

Hello,

I am facing issues when trying to spin up multiple microgateways.

Below are my environment details

OPDK - 4.17.01.01

OS - RHEL 7.2

Microgateway version - 2.3.5

Node JS Version - 6.10.0

We have configured our Apigee enviornment in such a way that there is one org say "org1" and multiple environments namely "env1", "env2", "env3"...Each environment has the virtual host named "default".

I was able to setup and configure the first Micro-gateway "mgwy1" successfully in a seperate VM, pointing to "org1" and "env1" using the virtual host "default".

When I try to configure the second micro-gateway in a different VM with "org1" and "env2", I am getting the following error. Even I tried configuring the gateway with "org1" and "env1", but the same result. Configuration process tries to deploy 2 internal proxies namely edgemicro-auth & edgemicro_internal. Since these proxies were already deployed during the first Microgateway "mgwy1" configuration, it reports the below error when configuring the second microgateway "mgwy2". Below are the logs.

Can someone suggest how to fix this error?

[root@SERVER1 ~]# edgemicro private configure -o org1 -e env2 -r http://abc.com:9001 -m http://abc.com:8080 -v default -u a@b.com -p password1

current nodejs version is v6.10.0

current edgemicro version is 2.3.5

delete cache config

init config file doesn't exist, setting up

configuring edgemicro internal proxy

deploying edgemicro internal proxy

deploying edgemicro-auth app

Give me a minute or two... this can take a while...

{ Error: cannot POST http://abc.com:8080/v1/organizations/org1/apis/edgemicro-auth/revisions/1/resources?name=micro-gatew... (409) at translateError (/usr/local/nodejs/lib/node_modules/edgemicro/cli/lib/deploy-auth.js:246:11) at Request._callback (/usr/local/nodejs/lib/node_modules/edgemicro/cli/lib/deploy-auth.js:199:11) at Request.self.callback (/usr/local/nodejs/lib/node_modules/edgemicro/node_modules/request/request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/usr/local/nodejs/lib/node_modules/edgemicro/node_modules/request/request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage.<anonymous> (/usr/local/nodejs/lib/node_modules/edgemicro/node_modules/request/request.js:1091:12) at IncomingMessage.g (events.js:291:16) text: '{\n "code" : "messaging.config.beans.ResourceAlreadyExists",\n "message" : "Resource with name micro-gateway-products-javacallout-1.0.0.jar and type java already exists",\n "contexts" : [ ]\n}' }

0 3 144
3 REPLIES 3

Former Community Member
Not applicable

I suspect the command here requires more attention:

-r http://abc.com:9001 -m http://abc.com:8080

-r is the router IP and Port. When you defined "default" virtual host in each environment, I'm sure you gave it a unique IP and/or Port.

-m is the management server IP and Port. This will be the same for all the envs.

Nope. All the VH points in different environments points to the same IP & same Port. Multiple environments were created to enable different teams have their own environments.

So, based on your comment, does it mean that only one Microgateway can be configured per environment? Cant we have multiple microgateways configured to use the same environment?

We planned to use Multiple micro gateways with the idea that each microgateway frontface a micro service.

Former Community Member
Not applicable

You can have as many microgateways linked to the same environment. However, it is the virtual hosts that have a problem. Each environment requires a unique endpoint (ip:port) on the apigee router. If all the environments have the same IP and port, how can the apigee router distinguish between different environments and route traffic?

here are your options:

1) If you want all your environments on the same VM, the each environment requires a unique port (on the apigee router). This is done when you setup the virtual host in that environment.

2) If your environments are on different VMs, then you'll have unique IPs for each environment. Again, this is provided during the VH configuration.