On-premises Edge 4.16.01 - Analytics for new Environment.

I am having issue with analytic configuration for new environment created. I have created a new environment by calling management apis mentioned at

http://docs.apigee.com/api-services/latest/creating-organization-environment-and-virtual-host

I have created environment then virtual hosts and enabled-ax using command apigee/apigee-service/bin/apigee-service apigee-provision enable-ax -f configFile.

Now when I check ax status I got following error :

[~~]#  curl -u "xx" "http://{MS}/v1/organizations/xx/environments/dev/provisioning/axstatus"
Enter host password for user xxx:
{
  "environments" : [ {
  "components" : [ {
  "hosts" : "[localhost]",
  "message" : "success",
  "name" : "qs",
  "status" : "SUCCESS",
  "uuid" : "[5f0f71c5-020a-40ef-b77e-c7decc96fec0]"
  } ],
  "message" : "Mandatory nodes pg and qs are not present",
  "name" : "dev"
  }, {
  "components" : [ {
  "hosts" : "[localhost]",
  "message" : "success",
  "name" : "qs",
  "status" : "SUCCESS",
  "uuid" : "[5f0f71c5-020a-40ef-b77e-c7decc96fec0]"
  }, {
  "hosts" : "[localhost]",
  "message" : "success at Wed Jun 08 20:35:43 CDT 2016",
  "name" : "pg",
  "status" : "SUCCESS",
  "uuid" : "[dcbd0ece-f15c-4b6f-b04d-1111c8f3af2f]"
  } ],
  "message" : "",
  "name" : "dev"
  } ],
  "organization" : "fis",
  "status" : "FAILURE"

Please advise what I should to fix this. thanks.

Can you provide the output of this management command:

curl -u sysadmin@email.com http://{MS}:8080/v1/analytics/ax/groups

Hi @cocoandjan please find the AX Groups below.

[xx~]#  curl -u "xx" "http://xxx/v1/analytics/groups/ax" Enter host password for user xx:

[ {
  "name" : "axgroup-001",
  "properties" : {
  "consumer-type" : "ax"
  },
  "scopes" : [ "fis~dev" ],
  "uuids" : {
  "postgres-server" : [ ],
  "qpid-server" : [ "5f0f71c5-020a-40ef-b77e-c7decc96fec0" ]
  },
  "consumer-groups" : [ {
  "name" : "consumer-group-001",
  "consumers" : [ "5f0f71c5-020a-40ef-b77e-c7decc96fec0" ],
  "datastores" : [ ],
  "properties" : {
  }
  } ],
  "data-processors" : {
  }
}, {
  "name" : "axgroup001",
  "properties" : {
  "consumer-type" : "ax"
  },
  "scopes" : [ "fis~test", "fis~dev" ],
  "uuids" : {
  "postgres-server" : [ "dcbd0ece-f15c-4b6f-b04d-1111c8f3af2f" ],
  "qpid-server" : [ "5f0f71c5-020a-40ef-b77e-c7decc96fec0" ]
  },
  "consumer-groups" : [ {
  "name" : "consumer-group-001",
  "consumers" : [ "5f0f71c5-020a-40ef-b77e-c7decc96fec0" ],
  "datastores" : [ "dcbd0ece-f15c-4b6f-b04d-1111c8f3af2f" ],
  "properties" : {
  }
  } ],
  "data-processors" : {
  }
} ]

It looks like you may have ran the enable-ax twice on the fish~dev (org/env)?

In any case, you can see you have 2 analytics groups:

axgroup001 - correctly configured

axgroup-001 - incorrectly configured, and should be deleted.

Remove the axgroup-001 with management calls:

  1. remove the fix~dev scope from axgroup-001

curl -v -u sysadmin@email.com -X DELETE ā€˜http://{MS}:8080/v1/analytics/groups/ax/axgroup-001/scopes?org=fis&env=dev’

  1. remove the uuid for your consumer in consumer-group-001 in axgroup-001:

curl -v -u sysadmin@email.com -X DELETE -H ā€˜Accept:application/json’ -H ā€˜Content-Type:application/json’ ā€˜http://{MS}:8080/v1/analytics/groups/ax/axgroup-001/consumer-groups/consumer-group-001/consumers/5f0f71c5-020a-40ef-b77e-c7decc96fec0’

  1. remove the uuid for your qpid-server in the main axgroup-001:

curl -X DELETE -u sysadmin@email.com ā€œhttp://{MS}:8080/v1/analytics/groups/ax/axgroup-001/servers?uuid=5f0f71c5-020a-40ef-b77e-c7decc96fec0&type=qpid-serverā€ -H ā€œContent-type: application/jsonā€

  1. remove the consumer-group-001 in axgroup-001:

curl -v -u sysadmin@email.com-X DELETE ā€˜http://{MS}:8080/v1/analytics/groups/ax/axgroup-001/consumer-groups/consumer-group-001’

  1. remove the axgroup-001:

curl -u sysadmin@email.com http://{MS}:8080/v1/analytics/groups/ax/axgroup-001 -X DELETE

After the above, restart your analytics nodes and management node(s) and check analytics provisioning again and it should change to SUCCESS, if the above works.

1 Like

Hi @cocoandjan

Thank you very much. Step 1 itself fixed my issue.

Where as I was not able to remove qpid servers from axgroup-001 and remove that group.

I was getting error as below:

[~]#curl -u xxx -v -X DELETE 'http://xx/v1/analytics/groups/ax/axgroup-001/servers?uuid=5f0f71c5-020a-40ef-b77e-c7decc96fec0&type=qpid-server'

Enter host password for user xx:
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Thu, 09 Jun 2016 16:33:11 GMT
< Content-Length: 100
<
{
  "error" : "Server 5f0f71c5-020a-40ef-b77e-c7decc96fec0 is currently used in group axgroup-001"

Analytics on dev environment is success now:

[~] curl -u "xx" "http://xx/v1/organizations/fis/environments/dev/provisioning/axstatus"  Enter host password for user xx:
{
  "environments" : [ {
  "components" : [ {
  "hosts" : "[localhost]",
  "message" : "success",
  "name" : "qs",
  "status" : "SUCCESS",
  "uuid" : "[5f0f71c5-020a-40ef-b77e-c7decc96fec0]"
  }, {
  "hosts" : "[localhost]",
  "message" : "success at Wed Jun 08 20:35:43 CDT 2016",
  "name" : "pg",
  "status" : "SUCCESS",
  "uuid" : "[dcbd0ece-f15c-4b6f-b04d-1111c8f3af2f]"
  } ],
  "message" : "",
  "name" : "dev"
  } ],
  "organization" : "fis",
  "status" : "SUCCESS"

Hi @Pravin,

Thanks for the feedback! I’m glad that worked.

Step 2 did not work since I gave you the wrong management API call. I have edited my response and corrected the API call.

I would recommend you to still run through the steps 2 (Corrected step 2) through 5 to cleanup these items in your zookeeper. Since axgroup-001 is not in use, it should really be deleted from zookeeper so that it doesn’t cause any problems in the future.

Thanks,

Janice

1 Like

@cocoandjan

Updated commands worked perfectly. It has deleted unused axgroup-001. thanks again !!

Hi @cocoandjan,

I am also facing the same issue and tried to follow the above steps. Everything worked find and I was able to remove all the scope and consumer but failed to delete the postgres-server. When I executed the command:

curl -v -X DELETE -H ā€˜Content-type: application/json’ ā€˜http://{MS:PORT}/v1/analytics/groups/ax/axgroup-001/servers?uuid=0cee1536-c746-458e-beb7-f151262a3293&type=postgres-server’

It deleted the server type from the server details but the UUID still exists.

See the below group details I am left with and unable to remove the postgres-server and datastores from it.

Any suggestions?

[ {
  "name" : "axgroup-001",
  "properties" : {
  },
  "scopes" : [ ],
  "uuids" : {
    "qpid-server" : [ ],
    "postgres-server" : [ "6472b804-a6a3-437d-829a-9b73a50bfa25:0cee1536-c746-458e-beb7-f151262a3293" ]
  },
  "consumer-groups" : [ {
    "name" : "consumer-group-001",
    "consumers" : [ ],
    "datastores" : [ "6472b804-a6a3-437d-829a-9b73a50bfa25:0cee1536-c746-458e-beb7-f151262a3293" ],
    "properties" : {
    }
  } ],
  "data-processors" : {
  }
},

@Gagandeep Singh

you may try following to delete datastores. Your command to delete postgres-server looks good.

To delete datastores:

curl -v -u {{Sysadmin}} -X DELETE -H ā€˜Accept:application/json’ -H ā€˜Content-Type:application/json’ ā€˜http://{{MSIP :PORT}}/v1/analytics/groups/ax/axgroup-001/consumer-groups/consumer-group-001/datastores/0cee1536-c746-458e-beb7-f151262a3293’

@Pravin

I had tried this earlier also but no success. See the response below:

[server]# curl -v -u {{sysadmin}} -X DELETE -H ā€˜Accept:application/json’ -H ā€˜Content-Type:application/json’ ā€˜http://{{MS}}:{{PORT}}/v1/analytics/groups/ax/axgroup-001/consumer-groups/consumer-group-001/datastores/0cee1536-c746-458e-beb7-f151262a3293’

  • About to connect() to {{IP}} port 8080 (#0)

  • Trying {{IP}}… connected

  • Connected to {{IP}}({{IP}}) port 8080 (#0)

  • Server auth using Basic with user ā€˜{{sysadmin}}’

DELETE /v1/analytics/groups/ax/axgroup-001/consumer-groups/consumer-group-001/datastores/0cee1536-c746-458e-beb7-f151262a3293 HTTP/1.1

Authorization: Basic b3BzYXBpZ2VEGIDtaW5AYm9vdHMhY44udWs6MW5jQHJyZWNU

User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

Host: {{IP}}:{{PORT}} > Accept:application/json

Content-Type:application/json

< HTTP/1.1 200 OK < Content-Type: application/json

< Date: Wed, 28 Sep 2016 10:21:21 GMT

< Content-Length: 465

<

{

ā€œnameā€ : ā€œaxgroup-001ā€,

ā€œpropertiesā€ : {

},

ā€œscopesā€ : ,

ā€œuuidsā€ : {

ā€œqpid-serverā€ : ,

ā€œpostgres-serverā€ : [ ā€œ6472b804-a6a3-437d-829a-9b73a50bfa25:0cee1536-c746-458e-beb7-f151262a3293ā€ ]

},

ā€œconsumer-groupsā€ : [ {

ā€œnameā€ : ā€œconsumer-group-001ā€,

ā€œconsumersā€ : ,

ā€œdatastoresā€ : [ ā€œ6472b804-a6a3-437d-829a-9b73a50bfa25:0cee1536-c746-458e-beb7-f151262a3293ā€ ],

ā€œpropertiesā€ : {

}

} ],

ā€œdata-processorsā€ : {

}

  • Connection #0 to host {{IP}} left intact

  • Closing connection #0

for some reason your UUID format is different than mine, please try giving complete UUID

6472b804-a6a3-437d-829a-9b73a50bfa25:0cee1536-c746-458e-beb7-f151262a3293

thanks.

This is really helpful. I was getting same error and I followed steps provided and it works fine. Thank you so much.