In this paper, we investigate the problem of energy cost minimization for geographically distributed data centers with the guaranteed quality of service (i.e., service delay) under time-varying system dynamics. In order to satisfy the user demands, these data centers (DCs) consume a large amount of energy. The increasing energy cost of the DCs is a contemporary problem for the online service providers. To reduce the energy cost of the DCs, recent research studies suggest the workload distribution techniques among geo-distributed data centers by exploiting the dynamic electricity prices and an increased use of the renewable energy. In this paper, we propose a green geographical load balancing (GreenGLB) online algorithm based on the greedy algorithm design technique for the interactive and indivisible workload distribution. An indivisible workload is a sequential task, which cannot be further divided and must be assigned to a single data center. The basic idea of our algorithm is to assign the incoming workload at each time considering the current offered prices of electricity, the renewable energy levels, and respecting the given set of constraints. The experimental results based on the real-world traces illustrate the effectiveness of GreenGLB over the existing workload distribution techniques and attain a significant reduction in the energy cost of the geo-distributed DCs.INDEX TERMS Energy efficiency in cloud computing, geographical load balancing, geographically distributed data centers, green computing, dynamic electricity prices.