Some simple rules you will have to keep in mind:
- Setup 1 server (master) for writing data.
- Setup 1 or more servers (slaves) for reading data.
This way, you will avoid errors.
For example: If your script insert into the same tables on both master and slave, you will have duplicate primary key conflict.
You can view the "slave" as a "backup" server which hold the same information as the master but cannot add data directly, only follow what the master server instructions.
NOTE: Of course you can read from the master and you can write to the slave but make sure you don't write to the same tables .
I would recommend to monitor your servers to make sure everything is fine.
Hope this is helpful!