This brief investigates an optimal consensus problem for a set of integrator systems with dynamic uncertainties. A hierarchical distributed control framework based on partial global information is given, which can reach the optimal solution of the team objective function. Each agent has an optimal control law based on the neighbors’ information and the gradients of the local cost functions, and a compensator derived with Lyapunov redesign technique to deal with the dynamic uncertainties. Then, to remove the constraint on initial conditions and the need for global knowledge of the state, the state differences between neighbors are involved to strengthen the optimal controller while local information feedback is included in the compensator. The resulted fully distributed algorithms can guarantee asymptotic convergence of the systems in the sense of input-to-state stability (ISS). The effectiveness of the method is illustrated by numerical examples.