2. If $a$ and $b$ are positive numbers, and the equations $x^{2}+a x+2 b=0$ and $x^{2}+2 b x+a=0$ both have real roots, then the minimum value of $a+b$ is ( ).
(A) 4
(B) 5
(C) 6
(D) 7
2. C.

According to the problem, we have
$$
\left\{\begin{array}{l}
\Delta_{1}=a^{2}-8 b \geqslant 0, \\
\Delta_{2}=(2 b)^{2}-4 a \geqslant 0 .
\end{array}\right.
$$

From (1), $a^{2} \geqslant 8 b$.
From (2), $b^{2} \geqslant a$.
Since $a, b$ are positive numbers,
$$
\therefore b^{4} \geqslant a^{2} \text {. }
$$

From (3) and (4), we get $b^{4} \geqslant 8 b$.
$$
\begin{array}{l}
\therefore b(b-2)\left(b^{2}+2 b+4\right) \geqslant 0 . \\
\text { Since } b>0, b^{2}+2 b+4=(b+1)^{3}+3>0 . \\
\therefore b \geqslant 2 .
\end{array}
$$

From (3), $2^{2} \geq b \geqslant 16$.
$$
\therefore a \geqslant 4 \text {. }
$$

Therefore, $a+b \geqslant 6$.