2. Given positive integers $x_{1}, x_{2}, \cdots, x_{10}$ are all distinct, satisfying $x_{1}^{2}+x_{2}^{2}+\cdots+x_{10}^{2} \leqslant 2019$. Then
$$
x_{8}-\left(x_{5}+x_{4}+x_{3}+x_{2}+x_{1}\right)
$$

The maximum value is ( ).
(A) 7
(B) 8
(C) 9
(D) 10
2. C.

From the conditions, we know $x_{i} \geqslant i(i=1,2, \cdots, 10)$, and $x_{9} \geqslant x_{8}+1, x_{10} \geqslant x_{8}+2$.
Then $1^{2}+2^{2}+\cdots+7^{2}+x_{8}^{2}+\left(x_{8}+1\right)^{2}+\left(x_{8}+2\right)^{2}$ $\leqslant 2019$
$$
\Rightarrow x_{8}^{2}+2 x_{8}-624 \frac{2}{3} \leqslant 0 \Rightarrow x_{8} \leqslant 24 \text {. }
$$

When $x_{8}=24$, the conditions are satisfied.
Therefore, the maximum value sought is
$$
24-(5+4+3+2+1)=9 .
$$