This is a solution which we used:
All the configuration of local variables has been converted to use system properties.
The system property names were made designed in following manner
${nodename}_${nodenumber}_${propertyname}
and every server has variables defined for nodename and nodenumber in .profile file.
The properties file will define all the combinations. For example: we needed separate values of CONNECTION_COUNT so property file has 8 variables(4 for QA and 3 for PROD)
PROD_1_MAX_CONNECTION_COUNT=15
PROD_2_MAX_CONNECTION_COUNT=15
PROD_3_MAX_CONNECTION_COUNT=20
QA_1_MAX_CONNECTION_COUNT=12
QA_2_MAX_CONNECTION_COUNT=6
QA_3_MAX_CONNECTION_COUNT=10
QA_4_MAX_CONNECTION_COUNT=16
Now on each server(QA or PROD) the variable name is constructed by means of environment variables defined in .profile file and then appropriate property is picked up.
This allows us to get rid of any local changes on any of the nodes.