A major earthquake in the South Pacific Ocean has triggered a tsunami warning for several island nations and territories .