2. Given that $f(x)$ is a positive function defined on $\mathbf{R}$, and satisfies $f(x+1) f(x-1)=f(x)$, then it is a periodic function. One period of such a function is ( ).
(A) 2
(B) 3
(C) 4
(D) 6
2.D.

Substitute $x-1$ for $x$ in the equation, then we have
$$
f(x+1)=\frac{1}{f(x-2)} \text {. }
$$

Therefore, $f(x+3)=\frac{1}{f(x)}$.
Thus, $f(x+6)=\frac{1}{f(x+3)}=f(x)$.
Note: Here 6 is not necessarily the smallest positive period. For example, the constant function $f(x)=1(x \in \mathbf{R})$ also satisfies the condition, but this function does not have a smallest positive period.