We study the interactions of systems of two and three nondegenerate mesons composed of pions and kaons at maximal isospin using lattice QCD, specifically π+K+, π+π+K+ and K+K+π+. Utilizing the stochastic LapH method, we determine the spectrum of these systems on two CLS Nf = 2 + 1 ensembles with pion masses of 200 MeV and 340 MeV, and include many levels in different momentum frames. We constrain the K matrices describing two- and three-particle interactions by fitting the spectrum to the results predicted by the finite-volume formalism, including up to p waves. This requires also results for the π+π+ and K+K+ spectrum, which have been obtained previously on the same configurations. We explore different fitting strategies, comparing fits to energy shifts with fits to energies boosted to the rest frame, and also comparing simultaneous global fits to all relevant two- and three-particle channels to those where we first fit two-particle channels and then add in the three-particle information. We provide the first determination of the three-particle K matrix in π+π+K+ and K+K+π+ systems, finding statistically significant nonzero results in most cases. We include s and p waves in the K matrix for π+K+ scattering, finding evidence for an attractive p-wave scattering length. We compare our results to Chiral Perturbation Theory, including an investigation of the impact of discretization errors, for which we provide the leading order predictions obtained using Wilson Chiral Perturbation Theory.