There are many kinds of ions in vacuum arc discharge plasma, which have different distributions in space. In this paper, a compact magnetic analyzer is developed for studying the spatial distribution of deuterium ions and metal ions in vacuum arc discharge with occluded deuterium electrode. When the arc current is about 100 A, the device can effectively transfer the ion beam with good secondary electron suppression, and can accurately obtain the ion current intensity. The spatial distribution of deuterium ions and titanium ions in the vacuum arc discharge with TiD electrode are measured by this device. The results show that both deuterium ions and Titanium ions are Gaussian distribution in the radial direction, but deuterium ions are evenly distributed, while titanium ions are relatively concentrated near the axis, resulting in the lowest proportion of deuterium ions near the axis. Along the axis, the number of all ions decreases as a natural exponential function, and the relative magnitudes are approximately equal, so the proportion of deuterium ions is almost constant. The results of this study not only help to understand the plasma expansion process of vacuum arc discharge, but also guide the design of vacuum arc ion source with occluded deuterium electrode and its ion extraction.