Hybrid beamforming architecture, consisting of a low-dimensional baseband digital beamforming component and a high-dimensional analog beamforming component, has received considerable attention in the context of millimeter-wave massive multiple-input multiple-output systems. This is because it can achieve an effective compromise between hardware complexity and system performance. To avoid accurate estimation of the channel, a codebook-based technique is widely used in analog beamforming components, wherein a transmitter and receiver jointly examine an analog precoder and analog combiner pair according to predesigned codebooks, without using a priori channel information. However, identifying an optimal analog precoder and analog combiner pair using the exhaustive search algorithm (ESA) incurs exponential complexity, causing the number of radio frequency chains to proliferate and hindering the resolution of the phase shifters, which cannot be solved even for highly reasonable system parameters. To reduce the search complexity while maximizing the achievable rate, we propose a low-complexity, near-optimal algorithm developed from a cross-entropy optimization framework. Our simulation results reveal that our algorithm achieves near-optimal performance at a much lower complexity than does the optimal ESA.