2. In $\triangle A B C$, it is known that $A B=b^{2}-1, B C=$ $a^{2}, C A=2 a$, where $a$ and $b$ are both integers greater than 1. Then the value of $a-b$ is $\qquad$
2.0.

Since $a$ is an integer greater than 1, we have $a^{2} \geqslant 2 a$. By the triangle inequality, we get
$$
\begin{array}{l}
\left\{\begin{array}{l}
a^{2}+2 a>b^{2}-1, \\
2 a+b^{2}-1>a^{2}
\end{array}\right. \\
\Leftrightarrow(a-1)^{2}<b^{2}<(a+1)^{2} .
\end{array}
$$

Given $a, b \in \mathbf{N}_{+}$, hence $b=a$.