A tsunami warning has been issued for the Pacific Island of Tonga after a 7.1 magnitude earthquake struck nearby.