How to add a separate Java option per instance in GlassFish Cluster (Glassfish 4)? - glassfish

I have a cluster with 5 instances on Glassfish 4.
All are using the same configuration with the same Java options.
I want to add a Java option -Dcom.sun.management.jmxremote.port=**** for every instance in cluster, this means they all have to be different.
What is the best way to do that?
I can't move all instances to separate configurations,and I did not find any information about setting the parameters in instance system properties or instance properties.
Thank's for help!

The configuration for separate instances in cluster is the following.
1) Add a JVM option for the cluster configuration:
-Dcom.sun.management.jmxremote.port=${jmxremote.port}
2) Add an instance option at node properties:
jmxremote.port with your preferred prot number.
Save and restart instance.

Related

RabbitMQ : How to set and use custom environment variable in RabbitMQ Advance config file

We have configured RabbitMQ server to communicate with LDAP server for authentication which is working as expected. But we are facing one challenge where we need to externalize one value from configuration to environment variable.
so below is the current configuration present in advance.config file
{other_bind, {"CN=Service_Account,OU=Service Accounts,DC=XYZ,DC=com",{string,"123456"}}},
and want to make it something like this
{other_bind, {"CN=Service_Account,OU=Service Accounts,DC=XYZ,DC=com",{string,"${RABBITMQ_SERVICE_ACCOUNT_PASSWORD}"}}},
so as a result we wanted to externalize our password to some environment variable and use the same in advance.config file.
I tried setting value in rabbitmq-env.conf file but no luck.
Also as per this article we can't set a custom environment variable in rabbitmq-env.conf file, is it right? and if yes then where we can set this value?
https://riptutorial.com/rabbitmq/example/14032/configuring-rabbitmq-on--nix-systems
No, this is not supported:
{other_bind, {"CN=Service_Account,OU=Service Accounts,DC=XYZ,DC=com",{string,"${RABBITMQ_SERVICE_ACCOUNT_PASSWORD}"}}},
One option is to generate the advanced.config from a template before RabbitMQ starts. If RabbitMQ starts via systemd in your environment, you can use the ExecStartPre hook to run a custom script or program.
To create a drop-in override for the RabbitMQ systemd unit (and add ExecStartPre), follow these instructions:
https://wiki.archlinux.org/title/systemd#Editing_provided_units
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Running scripts in deployment manager

How do I run script along side a cluster instance that I am creating for configuring sql proxy using Google Deployment Manager ?
Startup scripts are not allowed to be specified for GKE nodes. From https://cloud.google.com/container-engine/reference/rest/v1/NodeConfig:
Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project or be one of the four reserved keys: "instance-template", "kube-env", "startup-script", and "user-data"
Take a look at https://github.com/kubernetes/contrib/tree/master/startup-script for a way to replace the functionality of startup scripts with a daemonset.

Mule Redis connector configuration is not consistent with its document

Recently we decided to add a cache layer to our mule APIs and Redis came to the scope.
We are at Mule3.8.0 and Redis connector 4.0.0. and we met following issues while configuring:
How to separate our keys by Redis DB ? This is not mentioned in document and there is only a 'Default Partition Name' in the configuration seems close but whatever value we put there, seems no effect - it will always be db0 containing all the keys, hence we can't really have "dev", "qa" and "test" key sets in the same redis cluster
The Redis connector document has example as below
<redis:sorted-set-select-range-by-index config- ref="Redis_configuration" key="my_key" start="0" end="-1" />
however when we tried the samething it complains the 'end' value should be >= 0 hence not usable
How to configure a connection pool properly with Redis connector configuration? Not mentioned in document again. The only attribute is the 'Pool Config Reference' and I tried to put a spring bean ref to my own JedisPoolConfig there, seems no effect, and number of the connections remains the same no matter what value I put in that bean.
Thanks in advance If someone could help with these issues above
James
How to separate our keys by Redis DB ?
You can use Redis in cluster mode with sharing data (http://redis.io/topics/cluster-tutorial)
I don't think you need special configuration in Mule.
I think you mix Partition term in Mule and Partition term in Redis.
Regards,

How can I create a new WebLogic managed server and add it to the cluster "dynamically"?

I want to be able to "spin up" additional WebLogic 11g managed servers in a cluster to add additional horizontal instances.
The use case is that I start with a WebLogic cluster that has X instances and I want to add an additional instance dynamically i.e. using a script and using a live system (without any downtime).
What can I use (e.g. WLST?) to create the additional managed server, configure it e.g. add it to the domain? Has anyone done this?
here is an example.
You can do a svr.setCluster and svr.setMachine
Here is an example with WLST:
Create:
connect('username','password')
edit()
startEdit()
cmo.createServer('managed1')
cd('Servers/managed1')
Add server to cluster (after cd to server added above)
cmo.setListenPort(ListenPort)
cmo.setCluster("MyCluster")
cmo.setMachine(Machinename)
Reaching/creating a cluster in WLST works in a similar way:
cd('/')
cmo.createCluster('MyCluster')
cd('/Clusters/MyCluster')
cmo.setClusterAddress('myhost:port,myhost2:port')
cmo.setClusterMessagingMode('unicast')

Force Glassfish to bind to a network interface

We are using Glassfish on multi homed servers and I would like to force Glassfish just to use one interface.
I updated domain.xml by
substituting every occurrence of 0.0.0.0 by the IP address
everywhere a port was mentioned without an address address=<IP> was added
every host=localhost was substituted with host=<IP>
After starting Glassfish several listeners are still listening on every available IP address:
3820: I tried to specify an address but the option is ignored
<iiop-listener port="3820" id="SSL" address="<IP>" security-enabled="true">
3920: same as above
<iiop-listener port="3920" id="SSL_MUTUALAUTH" address="127.0.0.1" security-enabled="true">
has no effect
7776: no idea
The next listeners use some dynamically generated ports
53491
53495
53496
53497
Now my question:
is there a way to make sure Glassfish will be using one and just one network interface?
if this cannot be achieved with Glassfish is there a way on a Linux system to trick an application to see only one interface?