2. For any integer $n(n \geqslant 2)$, let $N(n)$ be the maximum number of triples $\left(a_{i}, b_{i}, c_{i}\right)(i=1,2, \cdots, N(n))$, where $a_{i}, b_{i}, c_{i}$ are non-negative integers, and satisfy the following two conditions:
(1) For all $i, a_{i}+b_{i}+c_{i}=n$;
(2) If $i \neq j$, then $a_{i} \neq a_{j}, b_{i} \neq b_{j}, c_{i} \neq c_{j}$. Find $N(n)$.
2. Let the integer $n \geqslant 2, \left\{T_{1}, T_{2}, \cdots, T_{N}\right\}$ be any set of non-negative integer triples satisfying conditions (1) and (2).
Since the first component $a_{i}$ are all distinct, we have
$$
\sum_{i=1}^{N} a_{i} \geqslant \sum_{i=1}^{N}(i-1)=\frac{N(N-1)}{2} .
$$

Similarly,
$$
\sum_{2=1}^{N} b_{i} \geqslant \frac{N(N-1)}{2}, \sum_{i=1}^{N} c_{i} \geqslant \frac{N(N-1)}{2} .
$$

Adding the three inequalities and combining with condition (1), we get
$$
\begin{array}{l}
\frac{3 N(N-1)}{2} \leqslant \sum_{i=1}^{N} a_{i}+\sum_{i=1}^{N} b_{i}+\sum_{i=1}^{N} c_{i} \\
=\sum_{i=1}^{N}\left(a_{i}+b_{i}+c_{i}\right)=n N .
\end{array}
$$

Thus, $N \leqslant \frac{2 n}{3}+1$.
Therefore, $N \leqslant\left[\frac{2 n}{3}\right]+1$.
We now provide examples to show that $N(n)=\left[\frac{2 n}{3}\right]+1$ can be achieved.
When $n=3 k-1$, $\left[\frac{2 n}{3}\right]+1=2 k$. Take
$$
\left(a_{i}, b_{i}, c_{i}\right)=(i-1, k+i, 2 k-2 i),
$$

where $i=1,2, \cdots, k$,
$$
\left(a_{i}, b_{i}, c_{i}\right)=(i-1, i-k-1,4 k+1-2 i),
$$

where $i=k+1, k+2, \cdots, 2 k$.
When $n=3 k$, $\left[\frac{2 n}{3}\right]+1=2 k+1$. Take
$$
\left(a_{i}, b_{i}, c_{i}\right)=(i-1, k+i-1,2 k+2-2 i),
$$

where $i=1,2, \cdots, k+1$,
$$
\left(a_{i}, b_{i}, c_{i}\right)=(i-1, i-k-2,4 k+3-2 i),
$$

where $i=k+2, k+3, \cdots, 2 k+1$.
When $n=3 k+1$, $\left[\frac{2 n}{3}\right]+1=2 k+1$. Take
$$
\left(a_{i}, b_{i}, c_{i}\right)=(i-1, k+i-1,2 k+3-2 i),
$$

where $i=1,2, \cdots, k+1$,
$$
\left(a_{i}, b_{i}, c_{i}\right)=(i-1, i-k-2,4 k+4-2 i),
$$

where $i=k+2, k+3, \cdots, 2 k+1$.
Clearly, the chosen $a_{i}, b_{i}, c_{i}$ satisfy conditions (1) and (2).
Therefore, the value of $N(n)$ is $\left[\frac{2 n}{3}\right]+1$.