1

I have an ubuntu linux server that uses mysql cluster 7.2.5 x64.

Whenever I start an ndb node and check with ndb_mgm -e show, it stays in "starting" state for a long time. When I use top to check the process it takes 70-90% CPU which means it's doing something.

Is there a way to check what it's doing and estimate when it's going to finish?

4

You can view what is going on with ndb_mgm -e 'N report eventlog' where N is the data node's nodeid. This won't necessarily give you an estimate of when it will be finished but it can be used to verify that stuff is indeed going on and that the ndbd isn't just spinning indefinitely.

ndb_mgm -e 'all status' is also useful, as it will show you the current phase your data nodes are in. You can read more about phases in Summary of NDB Cluster Start Phases in the MySQL 5.5 Reference Manual.

1

The problem is the painfully slow phase 4. There have been some improvements in logging in the latest versions of ndb but the most useful check for this phase I have found is to keep an eye on the data memory.

I.e. compare

ndb_mgm -e'1 report memoryusage'
ndb_mgm -e'2 report memoryusage'

Once the starting node is using about as much as the other node(s) you are only a minute or so away.

So I use this

#!/bin/bash

id=${1//\'/}
ndb_mgm -e"$id status" | grep ': started' && exit 0 || ndb_mgm -e"$id start"

check=`ndb_mgm -e"$id status"`
count=0
echo $check
while [[ "$check" == *": starting"* ]]; do
  echo -n .
  count=$(( $count + 1 ))
  if [[ $(( $count % 12 )) == 0 ]]; then
    ndb_mgm -e"$id report memoryusage"
  fi
  sleep 5
  check=`ndb_mgm -e"$id status"`
done

if [[ "$check" == *": started"* ]]; then
  echo "$check ...about to double check status"
  sleep 10
  service mysql-ndbd status
else
  echo "FAILED: $check"
  exit 1
fi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.