Hello @Thanuja Kularathna ! Did you try to add these properties in Custom HDFS-site? You can do it by going to: Ambari > HDFS > Config > Advanced > Custom hdfs-site > Go to the bottom of the Custom hdfs-site and Add Property And then save the new properties added and restart the service. Hope this helps!
Making changes from backend is not recommended if you are using ambari managed cluster. However if you still want to do it, there is no need of restarting any service, but whenever you restart hdfs service from Ambari all your changes will be replaced by the configurations you see in Ambari UI.