2. If the function $f(x) = \log _{a} x(a>0$, and $a \neq 1)$ satisfies $f\left(\frac{2}{a}\right)>f\left(\frac{3}{a}\right)$, then the solution set for $f\left(1-\frac{1}{x}\right)>1$ is ( ).
(A) $0<x<\frac{1}{a}$
(B) $0<x<\frac{1}{1-a}$
(C) $1<x<\frac{1}{a}$
(D) $1<x<\frac{1}{1-a}$
2.D.

From $f\left(\frac{2}{a}\right)=\log _{a} \frac{2}{a}>f\left(\frac{3}{a}\right)=\log _{a} \frac{3}{a}$, we get $0<a<1$.
Therefore, the original inequality is equivalent to $0<1-\frac{1}{x}<a$.
Solving this inequality yields
$$
-1<-\frac{1}{x}<a-1 \Rightarrow 1<x<\frac{1}{1-a} .
$$