Why can't I choose to use specific message processors for a given environment in 4.16.01 like you could in prior versions.

david_ryan
Participant V
 
Solved Solved
1 24 521
1 ACCEPTED SOLUTION

sgilson
Participant V

Hi David,

You can still use this API call to do that:

curl -H "Content-Type:application/x-www-form-urlencoded" \
-u <admin user>:<admin passwd> -X POST \
http://<ms-ip>:8080/v1/organizations/<org-name>/environments/<env-name>/servers \
-d "action=add&uuid=<uuid>"

View solution in original post

24 REPLIES 24

Not applicable

Hmmmm... we're still having some issues getting 4.16.01 installed so we haven't reached this yet. But if this is true, this will keep us from upgrading our 4.15 to 4.16. This is how we keep our solutions isolated. Thus if the proxy code in one org goes nuts and chew resources, it can't bring down the MPs of the other solutions. Eager to see the answer to this.

Exactly why I ask the question. Why are planning on isolating, meaning dedicating a group of RMP servers to each env, which doesn't seem possible in the new version given my limited experience with it.

Whoops! It is absolutely possible; the underlying Admin APIs have not changed at all.

The thing that has changed is that there are perhaps modified or missing helper scripts. Either way, we'll get it sorted and get back to you.

Awesome, thanks. So just to clarify then we "should" have the ability to choose which MP's are associated with an env? Is this by script, or silent config, or both?

It is unusual for us - but we are starting our upgrades late (we usually try to have them out in prod 72 hours after release... )

Id love to know what problems people are having.. I wonder if there is a way to do this...

sgilson
Participant V

Hi David,

You can still use this API call to do that:

curl -H "Content-Type:application/x-www-form-urlencoded" \
-u <admin user>:<admin passwd> -X POST \
http://<ms-ip>:8080/v1/organizations/<org-name>/environments/<env-name>/servers \
-d "action=add&uuid=<uuid>"

Is this to say that when creating an org and/or environments, the process no longer asks what MPs you want associated to the org and/or environments?

The command to create an environment, like all commands in 4.16.01, is no longer interactive. Instead you pass a config file to the command. I'll find out if the config file takes a list of MPs, but the doc currently does not list that option. However, the API is available.

Stephen

Very cool. Thanks for the quick reply!!

BTW - didn't mean any negative connotation by saying "forces you to use...". I like having the config file over typing all the time, just wish there were options to define MP uuids. @sgilsonHopefully you can find that documentation.

I too am excited about the config file implementation. Makes setting up new data centers easier, as well as DR planning.

@sgilson Did you get any more info on if the config file takes a list MPs?

Still working on it. The developer has been out for the past two days. I am hoping to have an answer Weds.

@David Ryan it is not possible with a silent config file for 4.16.01 to specify the list of MPs. You have to use the APIs. I am filing an enhancement request to make it possible.

Stephen

Correct, the process no longer asks you and your forced to use a config file.

We have 30 servers across 2 data centers for 2 apigee env's. Once I created the env, I used the process above that @sgilson suggested, but it was quite painful removing 24 servers one at a time. I'd prefer to take an approach of which servers do you want to add and not what servers do you want to remove.

I did eventually do this but I noticed on all the routers, that I don't want to be part of that environment, are still configured and listening for that envioronment. Is there another step to make sure the routers that shoudn't be part of that environment are not configured?

In our on prem install we separate out R from MP. We noticed that all Rs listen on all ports. We separate out the traffic at our ELB. Thus our QA URL routes to one R, the STG URL routes to two Rs, etc. What is nice is if a R dies, any of the others can be used to route the traffic; they all will route to whatever MPs are associated to the org/env.

Hello,

Our on-premise setup has 2 Message Processors. I set up an organization with 5 environments. 3 are linked to both MP's, and the last 2 are linked to only one MP's to be able to test them seperately.

I used the above call to link the environments to a MP. For the 2, I just linked to only 1 MP.

Now these environments give an error on half the calls: 1 goes ok, the next fails, and so on.

This is the same for the 2 enviroments that are only linked to 1 MP.

Do I need extra config to get this working, this way?

Thanks,

Joris

Can you please specify what errors you are facing.

Try this command to find out if MP's associated with an env correctly:

curl -v -u $sysAdminEmail:$adminPasswd$mgmt_url/v1/o/$ORG_NAME/e/$env_name/servers

A little bit of context on how you created an org env would help me further.

Hi,

We are currently at 4.17.09.

This is an organization I created earlier, using the API commands as described on the Apigee website.

So I added some environments, using the API calls again:

- create env

- link to MP's

- Associate for analytics

- create tls keystores and virtual hosts

So 2 environments are linked to both MP's and 2 are linked to 1 MP, one for each.

The environments linked to both MP's work as expected.

Both environments which link to a single MP give an error each other call. So it looks like the routers are doing round-robin and 1 always fails.

One of these environments is not logging any analytics, the other one is.
When I link that environment to the second MP, all calls are working and the analytics are logged. When I remove the link again, the errors return and the analytics are not working anymore.

Does this give you more info?

Thanks,

Joris

It should work as expected and you should check with Apigee support on what could have gone wrong.

You can check nginx configuration and check whats happening:

In the edge-router machine 

cd /opt/nginx/config.d
check the file $org_$env_$vhost.conf for a parameter proxy_pass and see how many message processors they are linking to. 

I would also suggest you to delete that file /opt/nginx/config.d and restart your edge router.


Hi Rajesh,

Thank you for the info. (I cant see your reply on this page?)

cd /opt/nginx/config.d
check the file $org_$env_$vhost.conf for a parameter proxy_pass and see how many message processors they are linking to. 

I had these questions:

- is /opt/nginx/config.d the global config file? Removing it will have it created again when restarting the router?

- So is there a file for each $org_$env_$vh in this folder (/opt/nginx?)
Are these also recreated?

- Do you know where the link between the routers and MP's is configured? Is it possible that the router on server A only knows about the MP on server A? And similar for server B?

Thanks,

Joris

/opt/nginx/config.d the global config file - /opt/nginx directory is symlinked to /opt/apigee/edge-router/nginx directory and has all router specific configurations. If you remove any entries here, it will be recreated after router restart. When you make any changes through management server api calls related to org,env or vhost, it gets reflected here.

So is there a file for each $org_$env_$vh in this folder (/opt/nginx?) - Yes in /opt/nginx.d

Routers and MP's linked are read by nginx from proxy_pass variables in these conf files. These are always synched by making management services call. If you check the relevant conf files in router you will see the mp's mapping in those variables. However the source of truth will always be management server calls.

Hi - please do not ask new questions in comments to old questions from 2 years ago.

Post a new Question!

6534-ask-a-question.png