2. The number of triangles with integer side lengths and a perimeter of 20 is $\qquad$ .
2.8.

Let the three sides of a triangle be $a, b, c$, and $a \geqslant b \geqslant c$, $a+b+c=20$, then $a \geqslant 7$.
Also, from $b+c>a$, we get $2 a<a+b+c=20 \Rightarrow a<10$. Therefore, $7 \leqslant a \leqslant 9$. We can list
$$
\begin{array}{l}
(a, b, c)=(9,9,2),(9,8,3),(9,7,4),(9,6,5), \\
(8,8,4),(8,7,5),(8,6,6),(7,7,6) .
\end{array}
$$

There are 8 sets in total.