I read here http://motls.blogspot.de/2012/04/exceptional-lie-groups.html that the rank of group is
"the maximum number of independent U(1) generators".
In my understanding the rank of a group is defined as the number of generators that can be diagonalized simultaneously.
Are these two definitions equivalent and if yes, why?
So these two notions are equivalent in the context of compact Lie groups. In general, when we talk about rank of a compact Lie group, we mean the dimension of a \emph{maximal torus}, ie: the dimension of a maximal compact,connected, abelian subgroup $T\subset G$.
When you think of what those adjectives imply, we see that if $r$ is the rank, then $T\cong (S^1)^r \cong U(1)^r$.
So explicitly, we can see the connection to the notion of
for if we could find another element, $g$, independent of the $r$ generators of our torus $T\cong U(1)^r$, we could construct a larger torus, contradicting maximality of $T$.
Now, to relate this to your other notion, the only thing that needs to be said is that diagonalizable (more generally, the term is semisimple) elements live in tori. This is not obvious for general real Lie groups, and is very important.
So, in the context of compact Lie groups, we see that these two notions of rank agree.