Configuring Optimizer Hub Host and Port
As an Optimizer Hub administrator, you must provide users the host and ports for connecting to the service. Customers should use the host and port name in the OptHubHost
JVM parameter.
Determining the Optimizer Hub Endpoint
Use the IP address of the Optimizer Hub gateway
service as the connection endpoint for your JVMs.
Using an External Load Balancer
It is strongly recommended to use an external load balancer. If you correctly defined the load-balancer in values-override.yaml
as described in Installing Optimizer Hub, you can discover the external IP of the service using the following command:
$ kubectl describe service gateway -n my-opthub | grep 'LoadBalancer Ingress:'
LoadBalancer Ingress: internal-add1ff3e1591e4f93a49af3523b68e3b-1321158844.us-west-2.elb.amazonaws.com
JVM customers then connect using the following command:
java -XX:OptHubHost=internal-add1ff3e1591e4f93a49af3523b68e3b-1321158844.us-west-2.elb.amazonaws.com \
-XX:+EnableRNO \
-jar my-app.jar
Connecting Without an External Load Balancer
If you did not set up an external load balancer, you can find the endpoint using the following steps:
-
Run the following command:
kubectl -n my-opthub get services -
Look for the
gateway
service and note the ports corresponding to port 50051 inside the container. This is the port to use for connecting VMs to this Optimizer Hub cluster.service/gateway NodePort 10.233.15.55 <none> 8080:31951/TCP,50051:30926/TCP 52dIn this example the ports is
30926
.NoteOnly the internal ports 8080
and50051
in Optimizer Hub are fixed. The port in each setup is a random value. You need to use this lookup to find the port of your Optimizer Hub instance. -
Run the
kubectl get nodes
command and note the IP address or name of any node. -
Concatenate node IP with service ports to get something like
10.22.20.131:30926
. Do not prefix it withhttp://
. -
JVM customers set
-XX:OptHubHost=host:port
flag to the port mapped to 50051.java -XX:OptHubHost=10.22.20.131:30926 \ -XX:+EnableRNO \ -jar my-app.jar
Specifying a Custom Compiler Engine Upload Port
Cloud Native Compiler uses compiler engines to provide instructions for working with a specific version of the JVM. These compiler engines are not shipped with Cloud Native Compiler. When attempting to use Cloud Native Compiler for compilation, the JVM checks if the right compiler engine is present and, if not, automatically uploads it to Cloud Native Compiler.
If your Optimizer Hub instance is using default 8080 HTML ports, or you are fronting it with a load balancer, then there is nothing the user needs to do to configure uploads correctly. If you are connecting without a loadbalancer and are not using the default 8080 ports, follow the process described above to provide the JVM user with the host and port mapped to 8080. The JVM user must specify this host/port in the -XX:CNCEngineUploadAddress=host:port
. In the above example, the host/port combination is 10.22.20.131:30926
.