I'm not sure what documentation you've read so apologies if I'm repeating anything here.
To distribute reads to secondary nodes, most drivers allow you to set a readPreference value for the current session. Clients set read preference on a per-connection basis. With slaveOk, the driver should will always send queries to the secondaries, if they're available.
Distributing reads to secondaries requires the use of
ReplicaSetConnection with ReadPreference.SECONDARY.
See “rs.slaveOk()” for more information and this link.
In the mongo shell, to enable secondary reads, issue the following command :
rs.slaveOk()
The PHP documentation for it is here but I'm guessing that may be the documentation you're referring to.
As a FYI, here's an old discussion about it on the MongoDB Google Group.
If you're still having issues, I'd recommend using the MongoDB Google Group and providing some further information such as the version of MongoDB you're using, the version of the PHP driver, your log files, rs.conf() and rs.status().
As a FYI, you have to be careful with read scaling as sending too many reads to the secondaries can often result in the secondaries lagging the primary and becoming stale, thus requiring a full resync.
You can start a single node replica set by starting the mongod
with the replSet argument/config option, that is all that is required. It takes a name argument, which will then function as the name of the replica set in question. Once you have done that, you simply run rs.initiate() from the shell when connected to the node (this is only needed once).
This is described in detail here:
http://docs.mongodb.org/manual/tutorial/convert-standalone-to-replica-set/
To stay with just a single node, simply do not follow the "Expanding the set" instructions.
Best Answer
For minor versions its not an issue, although i would suggest to keep the same minor version across all nodes to avoid different behavior (due to different bugs and optimization patches between versions) after a stepdown. For major versions is fine when the primary is one major version behind the secondaries. Its not a good idea to have a primary on different major version from a secondary.