+++ This bug was initially created as a clone of Bug #1051015 +++ The default /etc/openshift/node.conf is installed with the following values defined: GEAR_MIN_UID=1000 # Lower bound of UID used to create gears GEAR_MAX_UID=6999 # Upper bound of UID used to create gears PROXY_MIN_PORT_NUM=35531 # Lower bound of port numbers used to proxy ports externally PROXY_PORTS_PER_GEAR=5 # Number of proxy ports available per gear Code looking for these values now looks for new names and ignores these. https://github.com/openshift/origin-server/blob/master/node/lib/openshift-origin-node/model/frontend_proxy.rb#L50 @port_begin = (config.get("PORT_BEGIN") || "35531").to_i @ports_per_user = (config.get("PORTS_PER_USER") || "5").to_i @uid_begin = (config.get("UID_BEGIN") || "500").to_i (I couldn't find any analog to GEAR_MAX_UID but should be consistent ). I think this happened around the v2 cartridge refactor, and actually there is some code looking at both forms (grep for GEAR_MIN_ID as well as UID_BEGIN). Most people never want to change the defaults, but they should be able to using what's in the config file. --- Additional comment from Luke Meyer on 2014-09-03 14:28:51 EDT --- I think this is "solved" by https://github.com/openshift/origin-server/pull/5780 which is intended to only change the default node.conf so users have some hope of understanding what they should do here. No code changes necessary. Here is my summary: Assuming districts, GEAR_MIN_UID and GEAR_MAX_UID no longer play any role except in an obscure calculation in application_container_ext/setup.rb where, as far as I can determine, the important thing is that they not change (no need to match the actual UIDs being used). As such, I've left them in the node.conf with their existing values (not the code defaults) and designated them as vestigial/do not change. PROXY_MIN_PORT_NUM and PROXY_PORTS_PER_GEAR no longer have any role at all so they've been removed from the node.conf. PORT_BEGIN and PORTS_PER_USER (which take over the functions these formerly held) have been added to node.conf with their code defaults and a fair amount of comments that I hope will help users. --- Additional comment from Luke Meyer on 2014-09-03 14:40:21 EDT --- I realized that oo-accept-node will now complain about the missing PROXY_ settings, so https://github.com/openshift/origin-server/pull/5781 addresses that.
What about UID_BEGIN? Its only use is in another obscure calculation, this time in node/lib/openshift-origin-node/model/frontend_proxy.rb where as with GEAR_MIN_UID the important thing is that it not change. This has never been set in node.conf so it never should be.
origin-server cherrypicks: commit 18a380023392daadd0a5c8da96fb8f6ea1b5b08f Author: Luke Meyer lmeyer Date: Sun Aug 31 20:07:29 2014 -0400 node.conf: comments for external port range commit a80d21486a579015e5daea83ad32f8da6c3133cb Author: Luke Meyer lmeyer Date: Wed Sep 3 14:35:56 2014 -0400 oo-accept-node: remove check for unused settings
Verify and pass on OSE 2.1.z/2014-09-04.1 1. After update, the node.conf was updated. ->pass 2. oo-accept-node using the uid from broker. -> pass 1) Modify first uid in openshift-origin-msg-broker-mcollective.conf 2) Modify the max uid in broker oo-admin-ctl-district -c remove-capacity -n sgears --size 100 oo-admin-ctl-district -c publish-uids 3) oo-accept-node -v 3. PORT_BEGIN, PORTS_PER_USER take affect. ->pass
(Test scenarios for step 3 in comment #7) For step 3, The following scenarios are used to verify PORT_BEGIN, PORTS_PER_USER. 1) set PORT_BEGIN=65531, the oo-iptables-port-proxy will use proxy between 65531 to 65536. September 05 01:52:29 INFO Shell command 'oo-iptables-port-proxy addproxy 65531 "127.10.154.1:8080"' ran. rc=0 out=-I rhc-app-comm 1 -d 127.10.154.1 -p tcp --dport 8080 -j ACCEPT -m comment --comment 65531 September 05 01:52:34 INFO Shell command 'oo-iptables-port-proxy addproxy 65532 "127.10.154.2:8080"' ran. rc=0 out=-I rhc-app-comm 1 -d 127.10.154.2 -p tcp --dport 8080 -j ACCEPT -m comment --comment 65532 S 2) set PORTS_PER_USER=2, the app creation with jbosseap should fail due to no port available. Result: root@node1 node]# cat platform.log|grep "No ports were left available to map" September 05 04:10:59 INFO openshift-agent: request end: action=cartridge_do, requestid=57ad56d6d9b551ff8b9e9f56186f71c4, senderid=broker.ose.com.cn, statuscode=1, data={:time=>nil, :output=>"No ports were left available to map 127.8.146.129:5445: uid=4389", :exitcode=>1, :addtl_params=>nil}
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1183.html