There are two because one does cylinders 1-3 and the other does 4-6. They are screwed into the block 'underneath' the inlet manifold just below the head gasket line, roughly in line with cylinders 2 and 5. If they trip an error in the ECU it will limit or fix the ignition timing advance in what's called the 'knock control region' (KCR) of the ignition timing map. It's done to prevent engine damage.
Ignition timing at idle won't be included in the KCR, which might suggest you have another problem entirely.
Did you clear the ECU error codes, run the engine again (ie drive it for awhile) and then recheck the error codes ?? You should always follow that procedure to ensure that the error code isn't simply transient. Even if you did follow that procedure, the first thing you should do is check all the wiring and knock sensor connectors for damage or even simple disconnection. A knock sensor is basically a PZT, which are very simple and robust devices and while it is possible for one to fail, that's pretty uncommon. Testing is not simple and requires access to an oscilloscope to be absolutely sure, and even then there's a bit of interpretation required. Substitution of a known good one (or pair) is usually quicker. A new one from Nissan is probably at least a few hundred $$.