In this paper, a nearest centroid (NC) with Dtw barycenter averaging (DBA) based random forest is proposed for fault classification in hydraulic system. Hydraulic system is a nonlinear system and with some typical features of the fault mode: the diversity and complexity, the coupling between multiple components, the contingency and randomness, the concealment of faults, etc. Therefore, the faults diagnose are difficult for hydraulic system. Many different methods have been applied to hydraulic system faults diagnose in the past years, but these methods mostly focus on the nonlinear and complex structure of hydraulic system and ignore the timing characteristic of fault mode. In this paper, the proposed method will focus on the timing characteristic of the hydraulic system, and DBA is used to reduce the dimension and retain the features of the original data, at the same time, NC is used to obtain the feature and puts the feature to Random forest. The method can improve the accuracy and make the fault diagnose faster that have been proven in the experiment.