8. Let $a$ be a given positive real number, $n$ be a given integer greater than 1, and real numbers $x_{1}, x_{2}, \cdots, x_{n}$ satisfy
$$
\begin{array}{l}
x_{1}^{2}+x_{2}^{2}+\cdots+x_{n}^{2}=a . \\
\text { Then }\left(x_{1}-x_{2}\right)^{2}+\left(x_{1}-x_{3}\right)^{2}+\cdots+\left(x_{1}-x_{n}\right)^{2}+ \\
\left(x_{2}-x_{3}\right)^{2}+\cdots+\left(x_{2}-x_{n}\right)^{2}+\cdots+\left(x_{n-1}-x_{n}\right)^{2}
\end{array}
$$

the maximum value is $\qquad$
8. na.
$$
\text { Let } \begin{aligned}
A= & \left(x_{1}-x_{2}\right)^{2}+\left(x_{1}-x_{3}\right)^{2}+\cdots+\left(x_{1}-x_{n}\right)^{2}+ \\
& \left(x_{2}-x_{3}\right)^{2}+\cdots+\left(x_{2}-x_{n}\right)^{2}+\cdots+\left(x_{n-1}-x_{n}\right)^{2} .
\end{aligned}
$$

Then $A=(n-1)\left(x_{1}^{2}+x_{2}^{2}+\cdots+x_{n}^{2}\right)-$
$$
\begin{array}{c}
2\left(x_{1} x_{2}+x_{1} x_{3}+\cdots+x_{1} x_{n}+\right. \\
\left.x_{2} x_{3}+\cdots+x_{2} x_{n}+\cdots+x_{n-1} x_{n}\right) \\
=n\left(x_{1}^{2}+x_{2}^{2}+\cdots+x_{n}^{2}\right)-\left(x_{1}+x_{2}+\cdots+x_{n}\right)^{2}
\end{array}
$$
$\leqslant n a$.
The equality holds if and only if $\left\{\begin{array}{l}x_{1}^{2}+x_{2}^{2}+\cdots+x_{n}^{2}=a, \\ x_{1}+x_{2}+\cdots+x_{n}=0\end{array}\right.$.
Since $n \geqslant 2$, we can take
$$
x_{1}=\sqrt{\frac{a}{2}}, x_{2}=-\sqrt{\frac{a}{2}}, x_{3}=x_{4}=\cdots=x_{n}=0 \text {, }
$$

to make the equality hold.
Thus, $A_{\max }=n a$.