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
Show file tree
Hide file tree
Changes from 7 commits
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
8 changes: 6 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
default['ndb']['version'] = "#{node['ndb']['majorVersion']}.#{node['ndb']['minorVersion']}.#{node['ndb']['patchVersion']}"
default['ndb']['enabled'] = "true"
default['ndb']['glib_version'] = "2.28"
default['ndb']['cpu_platform'] = "x86_64"

default['ndb']['url'] = node['download_url'] + "/rondb-#{node['ndb']['version']}-linux-glibc#{node['ndb']['glib_version']}-x86_64.tar.gz"
default['ndb']['url'] = node['download_url'] + "/rondb-#{node['ndb']['version']}-linux-glibc#{node['ndb']['glib_version']}-#{node['ndb']['cpu_platform']}.tar.gz"
# checksum is not a security check - used to improve the speed of downloads by skipping if matched
# checksum calculated using: shasum -a 256 /var/www/hops/...tgz | cut -c-12
# checksum calculated using: sha256sum /var/www/hops/...tgz | cut -c-12
Expand All @@ -29,7 +30,9 @@
default['ndb']['bind_cpus'] = "false"

default['ndb']['mgmd']['port'] = 1186
default['ndb']['ndbd']['port'] = 10000
default['ndb']['mgmd']['pidfile'] = "ndb_mgmd.pid"
default['ndb']['ndbd']['port'] = 11860
default['ndb']['ndbd']['pidfile'] = "ndbmtd.pid"
default['ndb']['ndbd']['systemctl_timeout_sec'] = 3600
default['ndb']['ip'] = "10.0.2.15"

Expand Down Expand Up @@ -205,6 +208,7 @@
default['ndb']['mysqlx_socket'] = "#{node['ndb']['root_dir']}/mysqlx.sock"
default['ndb']['mysql_port'] = "3306"
default['ndb']['mysqlx_port'] = "33060"
default['ndb']['mysqld_pid'] = "mysqld.pid"

default['mysql']['localhost'] = "false"

Expand Down
1 change: 0 additions & 1 deletion recipes/mgmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
group "root"
mode 0754
cookbook 'ndb'
variables({ :node_id => found_id })
if node['services']['enabled'] == "true"
notifies :enable, resources(:service => service_name)
end
Expand Down
5 changes: 2 additions & 3 deletions recipes/mysqld.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
mode 0755
cookbook 'ndb'
variables({
:deps => deps,
:pid_file => "#{node['ndb']['log_dir']}/mysql_#{found_id}.pid"
:deps => deps
})
end

Expand Down Expand Up @@ -251,4 +250,4 @@
#{exec} -e "source #{grants_path}"
EOF
only_if {node['mysql']['onlinefs'].casecmp?("true")}
end
end
1 change: 0 additions & 1 deletion recipes/ndbd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
mode 0754
variables({
:deps => deps,
:node_id => found_id
})
if node['services']['enabled'] == "true"
notifies :enable, resources(:service => service_name)
Expand Down
13 changes: 11 additions & 2 deletions templates/default/mgm-server-start.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,20 @@ if [ ! -e <%= node['mysql']['base_dir'] %>/bin/ndb_mgmd ] ; then
exit 3
fi

INITIAL_START_ARG=
if [ -n "$INITIAL_START" ]; then
INITIAL_START_ARG="--initial"
maismail marked this conversation as resolved.
Show resolved Hide resolved
fi

SERVICE_ARG=
if [ -n "$SERVICE_NAME" ]; then
SERVICE_ARG="--service-name $SERVICE_NAME"
maismail marked this conversation as resolved.
Show resolved Hide resolved
fi

<% 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
<%= 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}
<% 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\"
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}\"
maismail marked this conversation as resolved.
Show resolved Hide resolved
<% end -%>


Expand Down
2 changes: 1 addition & 1 deletion templates/default/my-ndb.cnf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ socket = <%= node['ndb']['mysql_socket'] %>
mysqlx_port = <%= node['ndb']['mysqlx_port'] %>
mysqlx_socket = <%= node['ndb']['mysqlx_socket'] %>
bind-address = 0.0.0.0
pid-file = <%= node['ndb']['log_dir'] %>/mysql_<%= @mysql_id %>.pid
pid-file = <%= node['ndb']['log_dir'] %>/<%= node['ndb']['mysqld_pid'] %>
tmpdir = /tmp
max-connections = 512
max-prepared-stmt-count = 65530
Expand Down
2 changes: 1 addition & 1 deletion templates/default/mysqld.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ StartLimitBurst=10

[Service]
User = <%= node['ndb']['user'] %>
PIDFile = <%= @pid_file %>
PIDFile = <%= node['ndb']['mysqld_pid'] %>
kouzant marked this conversation as resolved.
Show resolved Hide resolved
maismail marked this conversation as resolved.
Show resolved Hide resolved
maismail marked this conversation as resolved.
Show resolved Hide resolved
ExecStart = <%= node['ndb']['scripts_dir'] %>/mysql-server-start.sh
ExecStop = <%= node['ndb']['scripts_dir'] %>/mysql-server-stop.sh
ExecReload = <%= node['ndb']['scripts_dir'] %>/mysql-server-restart.sh
Expand Down
2 changes: 1 addition & 1 deletion templates/default/ndb_mgmd.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ StartLimitBurst=20

[Service]
User = <%= node['ndb']['user'] %>
PIDFile = <%= "#{node['ndb']['log_dir']}" %>/ndb_<%= @node_id %>.pid
PIDFile = <%= "#{node['ndb']['log_dir']}" %>/<%= node['ndb']['mgmd']['pidfile'] %>
kouzant marked this conversation as resolved.
Show resolved Hide resolved
maismail marked this conversation as resolved.
Show resolved Hide resolved
ExecStart = <%= "#{node['ndb']['base_dir']}/scripts/mgm-server-start.sh" %>
ExecStop = <%= "#{node['ndb']['base_dir']}/scripts/mgm-server-stop.sh" %>
ExecReload = <%= "#{node['ndb']['base_dir']}/scripts/mgm-server-restart.sh" %>
Expand Down
4 changes: 4 additions & 0 deletions templates/default/ndbd-init.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ while [ $# -gt 0 ]; do
shift
done

SERVICE_ARG=
if [ -n "$SERVICE_NAME" ]; then
SERVICE_ARG="--service-name $SERVICE_NAME"
fi
maismail marked this conversation as resolved.
Show resolved Hide resolved

echo "Initializing Data Node <%= @node_id %>."
echo ""
Expand Down
12 changes: 9 additions & 3 deletions templates/default/ndbd-start.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ if [ "X$USERID" != "X<%= node['ndb']['user'] %>" ]; then
exit -3
fi

if [ "${NDBD_INITIAL_RESTART}" = "true" ]; then
INIT_ARG=
if [[ "${NDBD_INITIAL_RESTART}" = "true" || -n "${INITIAL_START}" ]]; then
mronstro marked this conversation as resolved.
Show resolved Hide resolved
INIT_ARG=--initial
sed -i 's/^NDBD_INITIAL_RESTART=.*$/NDBD_INITIAL_RESTART=false/g' <%= node['ndb']['scripts_dir'] %>/ndbd_env_variables
fi

SERVICE_ARG=
if [ -n "$SERVICE_NAME" ]; then
maismail marked this conversation as resolved.
Show resolved Hide resolved
SERVICE_ARG="--service-name $SERVICE_NAME"
fi

MGM_CONN=<%= node['ndb']['connectstring'] %>

# comma separated list of node-ids of nodes not to wait for when starting this ndbmtd
Expand Down Expand Up @@ -45,8 +51,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"
<%= node['mysql']['base_dir'] %>/bin/ndbmtd -c "$MGM_CONN" --ndb-nodeid=<%= @node_id %> --connect-retries=-1 --connect-delay=10 $INIT_ARG $NOWAIT_NODES_LIST
#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}

RES=$(echo $?)
exit $RES
2 changes: 1 addition & 1 deletion templates/default/ndbmtd.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ StartLimitBurst=10
[Service]
User = <%= node['ndb']['user'] %>
Nice = -20
PIDFile = <%= "#{node['ndb']['log_dir']}" %>/ndb_<%= @node_id %>.pid
PIDFile = <%= "#{node['ndb']['log_dir']}" %>/<%= node['ndb']['ndbd']['pidfile'] %>
kouzant marked this conversation as resolved.
Show resolved Hide resolved
maismail marked this conversation as resolved.
Show resolved Hide resolved
EnvironmentFile = <%= node['ndb']['scripts_dir'] %>/ndbd_env_variables
ExecStart = <%= "#{node['ndb']['base_dir']}/scripts/ndbd-start.sh" %>
ExecStop = <%= "#{node['ndb']['base_dir']}/scripts/ndbd-stop.sh" %>
Expand Down