An 8.0 earthquake in the South Pacific has triggered a tsunami warning for islands in the area.