When running the failover command, you can get an error message like the following:
$ hdfs --config $(pwd) haadmin -failover namenode2 namenode1
Failover failed: xxx.yyy/126.96.36.199:8020 is not ready to become active
Unfortunately, the error message doesn't describe why that node isn't ready to be active. In my case, the target namenode's logs don't indicate anything either. It turned out that the issue was "Safe mode is ON.Resources are low on NN. Safe mode must be turned off manually.", but ideally the user would be told that at the time of the failover.