I failed one portion of the RI exam. Do I have to retake both sections

No, you can just retake the section that you failed as long as it is within one year of the first time you took the exam. You'll still need to pay the $70 exam fee.