I have seen some posts about the length of time the UTF conversion takes. I am hesitant to make the update in my distributed environment due to not knowing how long this upgrade could take. I have seen posts of a 20 hour conversion on a 3G database. My zabbix DB is ~110G so would this take days? If so there has to be a better (faster) way. Any help/insight here would be greatly appreciated.
Ad Widget
Collapse
UTF8 and zabbix 1.8 upgrade
Collapse
X
-
You may skip historical tables having no text data: history, history_uint, trends, trends_uint. This would make transition much faster. -
Alexei, I noticed the upgrade script mentions it is not inteded for distributed monitoring databases... what does that mean? Should I not run it on the script on the master and child nodes?Version : 1.8.8
Current Configuration 1 Master and 3 Child NodesComment
-
1. if you do not need other scripts than the basic latin one, you can skip utf-8 conversion completely;
2. the bash script is not intended and tested for distributed setup databases. it will most likely miss some required changes.
the sql patches, official upgrade path, should support such databases, though. any problems with that should be reported (hint - test upgrade)Comment
-
upgrade script and UTF
Perhaps something like this will help for speeding up the UTF conversion, based on the suggestions in this thread. I will try tomorrow if the conversion takes too long.
"upgrade" script
=====================
Replace this section:
=====================
# ******************** 2
echo "Converting database to UTF8"
timer start conversion to UTF8
echo "ALTER DATABASE CHARACTER SET utf8;" | $MYSQL $MYSQLPARAMS
for i in $(echo "show tables;" | $MYSQL -N $MYSQLPARAMS); do
echo "... converting table $i"
echo "ALTER TABLE $i CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" | $MYSQL $MYSQLPARAMS
done
echo -n " ... "
timer stop conversion to UTF8
==========
With this:
==========
# ******************** 2
excluded=( history history_uint trends trends_uint )
function elementExists()
{
if [ -z "$1" ]
then
return
fi
for i in ${excluded[@]}
do
if [ $i == $1 ]
then
return 1
fi
done
return 0
}
echo "Converting database to UTF8"
timer start conversion to UTF8
echo "ALTER DATABASE CHARACTER SET utf8;" | $MYSQL $MYSQLPARAMS
for i in $(echo "show tables;" | $MYSQL -N $MYSQLPARAMS); do
elementExists $i
x=$?
if [ $x == "0" ]
then
echo "... converting table $i"
echo "ALTER TABLE $i CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" | $MYSQL $MYSQLPARAMS
fi
done
echo -n " ... "
timer stop conversion to UTF8Comment
-
oh, well... a shorter (i'm lazy
) version of skipping history & trends tables for that script was committed to svn. uncommenting single line should allow to leave all history & trends tables unconverted
Comment
-
Did you test it?
Maybe it does what _you_ want, but it surely isn't safe.Code:> # skiptables="history\|history_log\|history_str\|history_text\|history_uint\|trends\|trends_uint > 104c107 < for i in $(echo "show tables;" | $MYSQL -N $MYSQLPARAMS); do --- > for i in $(echo "show tables;" | $MYSQL -N $MYSQLPARAMS | grep -v "${skiptables:-not_skipping_any_tables}"); do
Including "history" skips also history_log, history_str,... (grep -v).
Or am I missing something here?
(There's missing "-char from end of skiptables-variable)Comment
-
Comment
-
I upgraded my installation on CentOS 5.5 x86_64 w/ your script.
Worked ok, but maybe you should give better help for usage?
Fg:
./upgrade --user=xxxx --password=xxxxxxx zabbix
I don't know what will happen if db is missing from parameters.
Could the script do it's job to mysql db...?Comment
-
well... that would be quite an encouragement to use it, given that it's not really supported...
it should pass through index & utf8 parts not doing anything, then fail on the patch stepComment
-
Comment
Comment