30. (2007 Western China Mathematical Olympiad) Find all positive integers $n$, such that there exist non-zero integers $x_{1}$, $x_{2}, \cdots, x_{n}, y$, satisfying
$$
\left\{\begin{array}{l}
x_{1}+\cdots+x_{n}=0, \\
x_{1}^{2}+\cdots+x_{n}^{2}=n y^{2} .
\end{array}\right.
$$
30. Clearly $n \neq 1$.

When $n=2 k$ is even, let $x_{2 i-1}=1, x_{2 i}=-1(i=1,2, \cdots, k), y=1$, then the conditions are satisfied.
When $n=3+2 k \quad\left(k \in \mathbf{N}_{+}\right)$, let
$$
y=2, x_{1}=4, x_{2}=x_{3}=x_{4}=x_{5}=-1, x_{2 i}=2, x_{2 i+1}=-2, i=3,4, \cdots, k+1 \text {, }
$$

then the conditions are satisfied.
When $n=3$, if there exist non-zero integers $x_{1}, x_{2}, x_{3}$, such that
$$
\left\{\begin{array}{l}
x_{1}+x_{2}+x_{3}=0 \\
x_{1}^{2}+x_{2}^{2}+x_{3}^{2}=3 y^{2},
\end{array}\right.
$$

then $2\left(x_{1}^{2}+x_{2}^{2}+x_{1} x_{2}\right)=3 y^{2}$.
Without loss of generality, assume $\left(x_{1}, x_{2}\right)=1$, then $x_{1}, x_{2}$ are both odd or one is odd and the other is even, thus $x_{1}^{2}+x_{2}^{2}+x_{1} x_{2}$ is odd. On the other hand, $2|y$, so $3 y^{2} \equiv 0(\bmod 4)$, while $2\left(x_{1}^{2}+x_{2}^{2}+x_{1} x_{2}\right) \equiv 2(\bmod 4)$, a contradiction!
In summary, the positive integers $n$ that satisfy the conditions are all positive integers except 1 and 3.