The shootings have rocked a community that describes itself as small and close-knit in Canada, where gun laws are stricter than in the United States.