6 Given a real number $a$ such that there is only one real number $x$ satisfying the inequality $\left|x^{2}+2 a x+3 a\right| \leqslant 2$, then the number of all real numbers $a$ that satisfy the condition is ().
(A) 1
(B) 2
(C) 3
(D) infinitely many
6 Let $f(x)=x^{2}+2 a x+3 a$, from $f\left(-\frac{3}{2}\right)=\frac{9}{4}$ we know, the graph of function $f(x)$ passes through the point $\left(-\frac{3}{2}, \frac{9}{4}\right)$. To make the inequality $\left|x^{2}+2 a x+3 a\right| \leqslant 2$ have only one solution, the graph of the parabola $f(x)=x^{2}+2 a x+3 a$ must be tangent to the line $y=2$, that is, the discriminant of $x^{2}+2 a x+3 a-2=0$ is $\Delta=4 a^{2}-4(3 a-2)=0$. Solving for $a$ yields $a=1$, 2. Therefore, the answer is B.