Error encountered after modified elasticsearch.yml

continued log due to word limits

Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0_151]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_151]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_151]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:1.8.0_151]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_151]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_151]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_151]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:421) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:68) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:307) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:262) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.bootstrap.Security.configure(Security.java:123) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:208) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.2.jar:6.2.2]
... 6 more
[2018-03-26T01:49:43,188][INFO ][o.e.n.Node ] [yk_search1] initializing ...
[2018-03-26T01:49:43,304][INFO ][o.e.e.NodeEnvironment ] [yk_search1] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [27.6gb], net total_space [29gb], types [ext4]
[2018-03-26T01:49:43,305][INFO ][o.e.e.NodeEnvironment ] [yk_search1] heap size [491.6mb], compressed ordinary object pointers [true]
[2018-03-26T01:49:43,306][INFO ][o.e.n.Node ] [yk_search1] node name [yk_search1], node ID [LlNC66V1Tr-5ygQzoaq7DQ]
[2018-03-26T01:49:43,309][INFO ][o.e.n.Node ] [yk_search1] version[6.2.2], pid[8060], build[10b1edd/2018-02-16T19:01:30.685723Z], OS[Linux/4.4.0-1052-aws/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_151/25.1
51-b12]
[2018-03-26T01:49:43,310][INFO ][o.e.n.Node ] [yk_search1] JVM arguments [-Xms500m, -Xmx500m, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -
Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=fals
e, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.Rd5vHzo3, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintG
CApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch]
[2018-03-26T01:49:44,474][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [aggs-matrix-stats]
[2018-03-26T01:49:44,474][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [analysis-common]
[2018-03-26T01:49:44,475][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [ingest-common]
[2018-03-26T01:49:44,475][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [lang-expression]
[2018-03-26T01:49:44,475][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [lang-mustache]
[2018-03-26T01:49:44,475][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [lang-painless]
[2018-03-26T01:49:44,475][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [mapper-extras]
[2018-03-26T01:49:44,475][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [parent-join]
[2018-03-26T01:49:44,475][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [percolator]
[2018-03-26T01:49:44,476][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [rank-eval]
[2018-03-26T01:49:44,476][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [reindex]
[2018-03-26T01:49:44,476][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [repository-url]
[2018-03-26T01:49:44,476][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [transport-netty4]
[2018-03-26T01:49:44,476][INFO ][o.e.p.PluginsService ] [yk_search1] loaded module [tribe]
[2018-03-26T01:49:44,476][INFO ][o.e.p.PluginsService ] [yk_search1] no plugins loaded
[2018-03-26T01:49:47,696][WARN ][o.e.c.s.SettingsModule ] [yk_search1]


Found index level settings on node level configuration.

Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.In order to upgrade all indices the settings must be updated via the
/${index}/_settings API. Unless all settings are dynamic all indices must be closed
in order to apply the upgradeIndices created in the future should use index templates
to set default values.

Please ensure all required values are updated on all indices by executing:

curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
"index.number_of_replicas" : "0",
"index.number_of_shards" : "5"
}'