Ambient energy harvesting has emerged as a promising technique to improve the energy efficiency and reduce the total greenhouse gas emissions for green relay networks. In this paper, we study the joint relay selection and power control problem for the Decode-and-Forward energy-harvesting wireless relay network. In particular, the problem formulation is to maximize the end-to-end system throughput by a deadline under the limitations of data and energy storage. To solve the problem, we decompose such an optimization problem into two subproblems: the joint time scheduling and power control subproblem and the relay selection subproblem. Due to the convex nature of the joint time scheduling and power control subproblem, we derive the optimal solution via the primal decomposition. Based on the obtained system throughput, we can quickly select the best relay that achieves the maximum throughput. Simulation results show that the proposed algorithm can guarantee the maximum system throughput, in comparison with some existing algorithms.