No It is not ideal. It is up to you how to configure your cluster. In this tutorial, author decided to use node1
as P-NN and S-NN at the same time. Keep in mind that RPi Hadoop Cluster is suitable just for development and test and not production environment.
Pros and Cons of running Primary NameNode and Secondary NameNode on a separate machine(Based on This article from Cloudera):
1.Scalability. Creating the system snapshot requires about as much memory as the NameNode itself occupies. Since the memory available to
the NameNode process is a primary limit on the size of the distributed
filesystem, a large-scale cluster will require most or all of the
available memory for the NameNode.
2.Durability. When the SecondaryNameNode creates a checkpoint, it does so in a separate copy of the filesystem metadata. Moving this
process to another machine also creates a copy of the metadata file on
an independent machine, increasing its durability.