Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUD-464: Updates for Reconciliation #176

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Relay on Env vars for node_id and connection string
maismail committed Feb 2, 2024
commit 40bc71cda3b795463f5cfea7c238860e353af753
10 changes: 5 additions & 5 deletions templates/default/mgm-server-start.sh.erb
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@ if [ "X$USERID" != "X<%= node['ndb']['user'] %>" ]; then
exit -3
fi

echo "Testing to see if a cluster is already running on <%= node['ndb']['connectstring'] %> ..."
# <%= node['mysql']['base_dir'] %>/bin/ndb_mgm -c <%= node['ndb']['connectstring'] %> -e \"show\"> /dev/null
echo "Testing to see if a cluster is already running on ${MGM_CONN_STRING} ..."
# <%= node['mysql']['base_dir'] %>/bin/ndb_mgm -c ${MGM_CONN_STRING} -e \"show\"> /dev/null
ss -Hltu | grep -e "<%= node['ndb']['mgmd']['port'] %>\s"

if [ $? -eq 0 ] ; then
echo "A management server is already running on <%= node['ndb']['connectstring'] %>"
echo "A management server is already running on ${MGM_CONN_STRING} %>"
exit 2
fi

@@ -31,9 +31,9 @@ fi
SERVICE_ARG="--service-name ${SERVICE_NAME:-ndb_mgmd}"

<% if #{node['ndb']['use_systemd']} == "true" -%>
<%= node['mysql']['base_dir'] %>/bin/ndb_mgmd --ndb-nodeid=<%= @node_id %> -f <%= node['ndb']['root_dir'] %>/config.ini --configdir=<%= node['ndb']['mgm_dir'] %> --reload ${INITIAL_START_ARG} ${SERVICE_ARG}
<%= node['mysql']['base_dir'] %>/bin/ndb_mgmd --ndb-nodeid=${NDB_MGMD_NODE_ID} -f <%= node['ndb']['root_dir'] %>/config.ini --configdir=<%= node['ndb']['mgm_dir'] %> --reload ${INITIAL_START_ARG} ${SERVICE_ARG}
<% else -%>
su <%= node['ndb']['user'] %> -c \"<% node['mysql']['base_dir'] %>/bin/ndb_mgmd --ndb-nodeid=<%= @node_id %> -f <%= node['ndb']['root_dir'] %>/config.ini --configdir=<%= node['ndb']['mgm_dir'] %> --reload ${INITIAL_START_ARG} ${SERVICE_ARG}\"
su <%= node['ndb']['user'] %> -c \"<% node['mysql']['base_dir'] %>/bin/ndb_mgmd --ndb-nodeid=${NDB_MGMD_NODE_ID} -f <%= node['ndb']['root_dir'] %>/config.ini --configdir=<%= node['ndb']['mgm_dir'] %> --reload ${INITIAL_START_ARG} ${SERVICE_ARG}\"
<% end -%>


2 changes: 1 addition & 1 deletion templates/default/mysql-server-start.sh.erb
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ rm -f /tmp/mysql.sock.lock
export MYSQL_HOME=<%= node['ndb']['root_dir'] %>

if [ $SKIP_WAIT -ne 1 ] ; then
<%= node['mysql']['base_dir'] %>/bin/ndb_waiter -c <%= node['ndb']['connectstring'] %> --timeout=<%= node['ndb']['wait_startup'] %> 2>&1 > /dev/null
<%= node['mysql']['base_dir'] %>/bin/ndb_waiter -c ${MGM_CONN_STRING} --timeout=<%= node['ndb']['wait_startup'] %> 2>&1 > /dev/null
fi

<% if #{node['ndb']['use_systemd']} == "true" then -%>
6 changes: 3 additions & 3 deletions templates/default/ndbd-start.sh.erb
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ fi

SERVICE_ARG="--service-name ${SERVICE_NAME:-ndbmtd}"

MGM_CONN=<%= node['ndb']['connectstring'] %>
MGM_CONN=${MGM_CONN_STRING}

# comma separated list of node-ids of nodes not to wait for when starting this ndbmtd
NOWAIT_NODES_LIST=
@@ -49,8 +49,8 @@ done

echo "Starting Data Node <%= @node_id %>."
# --connect-retries == -1 implies that the ndbd keeps trying forever to connect to the ndb_mgmd
#su <%= node['ndb']['user'] %> -c "<%= node['mysql']['base_dir'] %>/bin/ndbmtd -c $MGM_CONN --ndb-nodeid=<%= @node_id %> --connect-retries=-1 --connect-delay=10 ${SERVICE_ARG}"
<%= node['mysql']['base_dir'] %>/bin/ndbmtd -c "$MGM_CONN" --ndb-nodeid=<%= @node_id %> --connect-retries=-1 --connect-delay=10 $INIT_ARG $NOWAIT_NODES_LIST ${SERVICE_ARG}
#su <%= node['ndb']['user'] %> -c "<%= node['mysql']['base_dir'] %>/bin/ndbmtd -c $MGM_CONN --ndb-nodeid=${NDB_NDBD_NODE_ID} --connect-retries=-1 --connect-delay=10 ${SERVICE_ARG}"
<%= node['mysql']['base_dir'] %>/bin/ndbmtd -c "$MGM_CONN" --ndb-nodeid=${NDB_NDBD_NODE_ID} --connect-retries=-1 --connect-delay=10 $INIT_ARG $NOWAIT_NODES_LIST ${SERVICE_ARG}

RES=$(echo $?)
exit $RES