Skip to content

Commit

Permalink
[PLAT-16465] Include YBC ports in on-prem preflight checks
Browse files Browse the repository at this point in the history
Summary: Include YBC port availability in the precheck. The checks are already present but we were not passing the ports down.

Test Plan:
Manually ran detached precheck:

```
2025-01-21T20:26:23.312Z  [info] bcd30940-9085-4e13-9903-07539e10a16a ShellProcessHandler.java:152 [TaskPool-0] com.yugabyte.yw.common.ShellProcessHandler Starting proc (abbrev cmd) - bin/ybcloud.sh onprem --region us-west-2 instance
precheck /tmp
2025-01-21T20:26:23.312Z  [info] bcd30940-9085-4e13-9903-07539e10a16a ShellProcessHandler.java:165 [TaskPool-0] com.yugabyte.yw.common.ShellProcessHandler Starting proc (full cmd) - 'bin/ybcloud.sh' 'onprem' '--region' 'us-west-2'
'--node_metadata'
'{"ip":"10.9.103.155","sshUser":"","region":"us-west-2","zone":"us-west-2c","instanceType":"c5.large","instanceName":"node-1","nodeName":"detached_node","nodeConfigs":[{"type":"HOME_DIR_SPACE","value":"13995"},{"type":"S3CMD","value":"true"},{"type":"SYSTEMD_SUDOER_ENTRY","value":"false"},{"type":"NODE_EXPORTER_RUNNING","value":"true"},{"type":"MASTER_HTTP_PORT","value":"{\"7000\":\"true\"}"},{"type":"YSQL_SERVER_RPC_PORT","value":"{\"5433\":\"true\"}"},{"type":"REDIS_SERVER_HTTP_PORT","value":"{\"11000\":\"true\"}"},{"type":"OPENSSL","value":"true"},{"type":"MASTER_RPC_PORT","value":"{\"7100\":\"true\"}"},{"type":"HOME_DIR_EXISTS","value":"true"},{"type":"ULIMIT_OPEN_FILES","value":"1048576"},{"type":"YB_CONTROLLER_RPC_PORT","value":"{\"18018\":\"true\"}"},{"type":"AZCOPY","value":"true"},{"type":"POLICYCOREUTILS","value":"true"},{"type":"DATA_DIR_CLEAN","value":"true"},{"type":"XXHASH","value":"false"},{"type":"NODE_EXPORTER_PORT","value":"{\"9300\":\"true\"}"},{"type":"TSERVER_RPC_PORT","value":"{\"9100\":\"true\"}"},{"type":"USER","value":"yugabyte"},{"type":"YCQL_SERVER_RPC_PORT","value":"{\"9042\":\"true\"}"},{"type":"YCQL_SERVER_HTTP_PORT","value":"{\"12000\":\"true\"}"},{"type":"GSUTIL","value":"true"},{"type":"YB_CONTROLLER_HTTP_PORT","value":"{\"14000\":\"true\"}"},{"type":"YSQL_SERVER_HTTP_PORT","value":"{\"13000\":\"true\"}"},{"type":"MOUNT_POINTS_VOLUME","value":"{\"/mnt/d0\":\"101605\"}"},{"type":"ULIMIT_USER_PROCESSES","value":"12000"},{"type":"SWAPPINESS","value":"0"},{"type":"TSERVER_HTTP_PORT","value":"{\"9000\":\"true\"}"},{"type":"VM_MAX_MAP_COUNT","value":"262144"},{"type":"REDIS_SERVER_RPC_PORT","value":"{\"6379\":\"true\"}"},{"type":"USER_GROUP","value":"yugabyte"},{"type":"YB_HOME_DIR_CLEAN","value":"true"},{"type":"MOUNT_POINTS_WRITABLE","value":"{\"/mnt/d0\":\"true\"}"},{"type":"PYTHON_VERSION","value":"3.6.8"},{"type":"ULIMIT_CORE","value":"unlimited"},{"type":"NTP_SERVICE_STATUS","value":"true"},{"type":"RSYNC","value":"true"}]}'
'instance' 'precheck' '--vars_file' '/opt/yugaware/keys/15a9bd2e-0bcb-4158-ae2b-2b1c4000f8a3/test-key-pair.vault' '--vault_password_file' '/opt/yugaware/keys/15a9bd2e-0bcb-4158-ae2b-2b1c4000f8a3/test-key-pair.vault_password'
'--private_key_file' '/opt/yugaware/keys/15a9bd2e-0bcb-4158-ae2b-2b1c4000f8a3/test-key-pair.pem' '--custom_ssh_port' '22' '--precheck_type' 'configure' '--ssh_user' 'yugabyte' '--install_node_exporter' '--mount_points' '/mnt/d0'
'--volume_size' '100' '--master_http_port' '7000' '--master_rpc_port' '7100' '--tserver_http_port' '9000' '--tserver_rpc_port' '9100' '--yb_controller_http_port' '14000' '--yb_controller_rpc_port' '18018' '--cql_proxy_http_port' '12000'
'--cql_proxy_rpc_port' '9042' '--ysql_proxy_http_port' '13000' '--ysql_proxy_rpc_port' '5433' '--redis_proxy_http_port' '11000' '--redis_proxy_rpc_port' '6379' '--node_exporter_http_port' '9300' '--connection_type' 'node_agent_rpc'
'--node_agent_ip' '10.9.103.155' '--node_agent_port' '9070' '--node_agent_cert_path' '/opt/yugaware/node-agent/certs/f33e3c9b-75ab-4c30-80ad-cba85646ea39/af2f200e-6cf9-4352-9e66-f9c8ad2b460f/1/ca.root.crt' '--node_agent_home'
'/home/yugabyte/node-agent' '--node_agent_auth_token' 'REDACTED' 'detached_node' '--remote_tmp_dir' '/tmp' - logging stdout=/tmp/shell_process_out8934608890143266429tmp, stderr=/tmp/shell_process_err11834174804737184111tmp
```

On clean node:

```
2025-01-21T20:26:40.445Z  [debug] bcd30940-9085-4e13-9903-07539e10a16a ShellProcessHandler.java:261 [TaskPool-0] com.yugabyte.yw.common.ShellProcessHandler     {
2025-01-21T20:26:40.445Z  [debug] bcd30940-9085-4e13-9903-07539e10a16a ShellProcessHandler.java:261 [TaskPool-0] com.yugabyte.yw.common.ShellProcessHandler       "type": "YB_CONTROLLER_HTTP_PORT",
2025-01-21T20:26:40.445Z  [debug] bcd30940-9085-4e13-9903-07539e10a16a ShellProcessHandler.java:261 [TaskPool-0] com.yugabyte.yw.common.ShellProcessHandler       "value": "{\"14000\":\"true\"}"
2025-01-21T20:26:40.445Z  [debug] bcd30940-9085-4e13-9903-07539e10a16a ShellProcessHandler.java:261 [TaskPool-0] com.yugabyte.yw.common.ShellProcessHandler     },

```
After running
```
python3 -m http.server 14000
```

```
2025-01-21T20:28:05.268Z  [debug] 47c4d254-3111-44d6-bba8-474c240cdd4e ShellProcessHandler.java:261 [TaskPool-1] com.yugabyte.yw.common.ShellProcessHandler     {
2025-01-21T20:28:05.268Z  [debug] 47c4d254-3111-44d6-bba8-474c240cdd4e ShellProcessHandler.java:261 [TaskPool-1] com.yugabyte.yw.common.ShellProcessHandler       "type": "YB_CONTROLLER_HTTP_PORT",
2025-01-21T20:28:05.268Z  [debug] 47c4d254-3111-44d6-bba8-474c240cdd4e ShellProcessHandler.java:261 [TaskPool-1] com.yugabyte.yw.common.ShellProcessHandler       "value": "{\"14000\":\"false\"}"
2025-01-21T20:28:05.269Z  [debug] 47c4d254-3111-44d6-bba8-474c240cdd4e ShellProcessHandler.java:261 [TaskPool-1] com.yugabyte.yw.common.ShellProcessHandler     },
```

Universe creation:
{F326929}

Reviewers: vpatibandla, vkumar, anijhawan

Reviewed By: vkumar, anijhawan

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D41380
  • Loading branch information
nkhogen committed Jan 22, 2025
1 parent 1e458c0 commit 79609c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions managed/devops/opscli/ybops/cloud/onprem/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def callback(self, args):
args.master_rpc_port,
args.tserver_http_port,
args.tserver_rpc_port,
args.yb_controller_http_port,
args.yb_controller_rpc_port,
args.cql_proxy_http_port,
args.cql_proxy_rpc_port,
args.ysql_proxy_http_port,
Expand Down
4 changes: 4 additions & 0 deletions managed/src/main/java/com/yugabyte/yw/common/NodeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2725,6 +2725,10 @@ private Collection<String> getCommunicationPortsParams(
result.add(Integer.toString(ports.tserverHttpPort));
result.add("--tserver_rpc_port");
result.add(Integer.toString(ports.tserverRpcPort));
result.add("--yb_controller_http_port");
result.add(Integer.toString(ports.ybControllerHttpPort));
result.add("--yb_controller_rpc_port");
result.add(Integer.toString(ports.ybControllerrRpcPort));
if (userIntent.enableYCQL) {
result.add("--cql_proxy_http_port");
result.add(Integer.toString(ports.yqlServerHttpPort));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,10 @@ private boolean isNodeConfigRequired(ValidationData input) {
case YCQL_SERVER_RPC_PORT:
case YSQL_SERVER_HTTP_PORT:
case YSQL_SERVER_RPC_PORT:
{
return !input.isDetached();
}
case YB_CONTROLLER_HTTP_PORT:
case YB_CONTROLLER_RPC_PORT:
{
// TODO change this to !input.isDetached() once the issue of not cleaning up yb_controller
// is fixed.
return false;
return !input.isDetached();
}
case NODE_EXPORTER_PORT:
{
Expand Down

0 comments on commit 79609c5

Please sign in to comment.