Service mongod fails after adding security.keyFile in config file
Use full path for keyfile. Don't use ~ -character there. Your mongod is started (probably) with user 'mongod' and that user don't have home directory.

Additionally keyfile must be have chmod 0400 and ownership same than user who run mongod process (mongod).