Skip to content

Commit

Permalink
[PLAT-15342] Install Node Agent as root level unit for ynp
Browse files Browse the repository at this point in the history
Summary: Install Node Agent as root level unit for ynp

Test Plan: ynp test

Reviewers: skhilar, anijhawan

Reviewed By: anijhawan

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D38171
  • Loading branch information
Vars-07 committed Sep 19, 2024
1 parent 1552321 commit ba6acbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ done


# Get the status of yb-node-agent Service
status=$(su - {{ yb_user }} -c \
"XDG_RUNTIME_DIR=/run/user/$(id -u {{ yb_user }}) systemctl --user show -p ActiveState \
\"$service_name\" | grep ActiveState | awk -F= '/ActiveState/ {print \$2}'")
status=$(systemctl show -p ActiveState "$service_name" | grep ActiveState | awk -F= '{print $2}')
if [ "$status" = "active" ]; then
echo "\"$service_name\" is active"
add_result "Service Status Check" "PASS" "$service_name is active"
Expand All @@ -57,9 +55,7 @@ else
fi

# Check the memory usage for yb-node-agent service
memory=$(su - {{ yb_user }} -c \
"XDG_RUNTIME_DIR=/run/user/$(id -u {{ yb_user }}) systemctl --user show -p MemoryCurrent \
\"$service_name\" | grep MemoryCurrent | awk -F= '/MemoryCurrent/ {print \$2}'")
memory=$(systemctl show -p MemoryCurrent "$service_name" | grep MemoryCurrent | awk -F= '{print $2}')
if [ "$memory" -gt 0 ]; then
echo "MemoryCurrent is greater than 0: $memory"
add_result "Memory Usage Check" "PASS" "MemoryCurrent is greater than 0: $memory"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,8 @@ su - {{ yb_user }} -c "\"$installer_dir/node-agent-installer.sh\" -c install \
--node_name {{ node_name }} --region_name {{ provider_region_name }} --node_ip {{ node_external_fqdn }} \
--bind_ip {{ bind_ip }} --silent --skip_verify_cert $airgap_flag"

loginctl enable-linger {{ yb_user }}
# install node_agent service
su - {{ yb_user }} -c "\"$installer_dir/node-agent-installer.sh\" -c install_service \
--user {{ yb_user }}"
"$installer_dir/node-agent-installer.sh" -c install_service --user {{ yb_user }}

if test -f "{{ tmp_directory }}/add_node_to_provider.json"; then
get_nodes_in_provider=$(_get_nodes_in_provider $yba_url $customer_uuid $provider_id)
Expand Down

0 comments on commit ba6acbd

Please sign in to comment.