This paper studies distributed resource allocation problem in multi-agent systems, where all the agents cooperatively minimize the sum of their cost functions with global resource constraints over stochastic communication networks. This problem arises from many practical domains such as economic dispatch in smart grid, task assignment, and power allocation in robotic control. Most of existing works cannot converge to the optimal solution if states deviate from feasible region due to disturbance caused by environmental noise, misoperation, malicious attack, etc. To solve this problem, we propose a distributed deviation-tracking resource allocation algorithm and prove that it linearly converges to the optimal solution with constant stepsizes. We further explore its resilience properties of the proposed algorithm. Most importantly, the algorithm still converges to the optimal solution under the disturbance injection and random communication failure. In order to improve the convergence rate, the optimal stepsizes for the fastest convergence rate are established. We also prove the algorithm converges linearly to the optimal solution in mean square even with uncoordinated stepsizes, i.e., agents are allowed to employ different stepsizes. Simulations are provided to verify the theoretical results.