A gunman who denounced Jews opened fire outside a German synagogue on Yom Kippur, the holiest day of the Jewish year, and killed two people as he live-streamed his attack.