I installed elasticsearch and then change the es_home path but now its not working.....this is the error i am getting after running, service elasticsearch status

this is the error i am getting : elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-07-11 07:46:57 UTC; 4min 29s ago
Docs: http://www.elastic.co
Process: 726 ExecStart=/usr/share/elasticsearch/bin/elasticsearch (code=exited, status=78)
Main PID: 726 (code=exited, status=78)
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: java.lang.NullPointerException: null
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.xpack.watcher.Watcher.close(Watcher.java:702) ~[?:?]
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:103) ~[elasticsearch-core-6.5.4.
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:85) ~[elasticsearch-core-6.5.4.j
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.node.Node.close(Node.java:923) ~[elasticsearch-6.5.4.jar:6.5.4]
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:103) ~[elasticsearch-core-6.5.4.
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:61) ~[elasticsearch-core-6.5.4.j
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.bootstrap.Bootstrap$4.run(Bootstrap.java:184) ~[elasticsearch-6.5.4.jar:6.5.
Jul 11 07:46:57 vyakar-stage-elastic systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/n/a
Jul 11 07:46:57 vyakar-stage-elastic systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
lines 1-17/17 (END)

Welcome. Could you try with 6.8.1 instead?

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

Also share elasticsearch logs if you still can't make it work.

`elasticsearch.service - Elasticsearch

Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-07-11 07:46:57 UTC; 4min 29s ago
Docs: http://www.elastic.co
Process: 726 ExecStart=/usr/share/elasticsearch/bin/elasticsearch (code=exited, status=78)
Main PID: 726 (code=exited, status=78)
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: java.lang.NullPointerException: null
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.xpack.watcher.Watcher.close(Watcher.java:702) ~[?:?]
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:103) ~[elasticsearch-core-6.5.4.
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:85) ~[elasticsearch-core-6.5.4.j
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.node.Node.close(Node.java:923) ~[elasticsearch-6.5.4.jar:6.5.4]
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:103) ~[elasticsearch-core-6.5.4.
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.core.internal.io.IOUtils.close(IOUtils.java:61) ~[elasticsearch-core-6.5.4.j
Jul 11 07:46:57 vyakar-stage-elastic elasticsearch[726]: at org.elasticsearch.bootstrap.Bootstrap$4.run(Bootstrap.java:184) ~[elasticsearch-6.5.4.jar:6.5.
Jul 11 07:46:57 vyakar-stage-elastic systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/n/a
Jul 11 07:46:57 vyakar-stage-elastic systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
lines 1-17/17 (END)`

Is this the right way to post question ?

No. And you are still not providing the logs.

these are the logs :

[2019-07-12T10:41:19,085][INFO ][o.e.e.NodeEnvironment    ] [CZ9Bazw] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [208gb], net total_space [228.1gb], types [ext4]
[2019-07-12T10:41:19,115][INFO ][o.e.e.NodeEnvironment    ] [CZ9Bazw] heap size [1007.3mb], compressed ordinary object pointers [true]
[2019-07-12T10:41:19,118][INFO ][o.e.n.Node               ] [CZ9Bazw] node name derived from node ID [CZ9BazwrTaOVCF43VTFwSw]; set [node.name] to override
[2019-07-12T10:41:19,119][INFO ][o.e.n.Node               ] [CZ9Bazw] version[6.5.4], pid[1043], build[default/deb/d2ef93d/2018-12-17T21:17:40.758843Z], OS[Linux/4.18.0-25-generic/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_211/25.211-b12]
[2019-07-12T10:41:19,119][INFO ][o.e.n.Node               ] [CZ9Bazw] JVM arguments [-Xms1g, -Xmx1g, -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=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.2lgonTh1, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/local/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=deb]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [aggs-matrix-stats]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [analysis-common]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [ingest-common]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [lang-expression]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [lang-mustache]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [lang-painless]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [mapper-extras]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [parent-join]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [percolator]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [rank-eval]
[2019-07-12T10:41:23,348][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [reindex]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [repository-url]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [transport-netty4]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [tribe]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-ccr]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-core]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-deprecation]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-graph]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-logstash]
[2019-07-12T10:41:23,349][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-ml]
[2019-07-12T10:41:23,350][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-monitoring]
[2019-07-12T10:41:23,350][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-rollup]
[2019-07-12T10:41:23,350][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-security]
[2019-07-12T10:41:23,350][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-sql]
[2019-07-12T10:41:23,351][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-upgrade]
[2019-07-12T10:41:23,351][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] loaded module [x-pack-watcher]
[2019-07-12T10:41:23,351][INFO ][o.e.p.PluginsService     ] [CZ9Bazw] no plugins loaded
[2019-07-12T10:41:32,428][INFO ][o.e.x.s.a.s.FileRolesStore] [CZ9Bazw] parsed [0] roles from file [/usr/local/elasticsearch/config/roles.yml]
[2019-07-12T10:41:33,724][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [CZ9Bazw] [controller/2283] [Main.cc@109] controller (64 bit): Version 6.5.4 (Build b616085ef32393) Copyright (c) 2018 Elasticsearch BV
[2019-07-12T10:41:34,773][DEBUG][o.e.a.ActionModule       ] [CZ9Bazw] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-07-12T10:41:35,232][INFO ][o.e.d.DiscoveryModule    ] [CZ9Bazw] using discovery type [zen] and host providers [settings]
[2019-07-12T10:41:37,083][INFO ][o.e.n.Node               ] [CZ9Bazw] initialized
[2019-07-12T10:41:37,083][INFO ][o.e.n.Node               ] [CZ9Bazw] starting ...
[2019-07-12T10:41:37,415][INFO ][o.e.t.TransportService   ] [CZ9Bazw] publish_address {10.249.186.101:9300}, bound_addresses {[::]:9300}
[2019-07-12T10:41:37,474][INFO ][o.e.b.BootstrapChecks    ] [CZ9Bazw] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-07-12T10:41:40,647][INFO ][o.e.c.s.MasterService    ] [CZ9Bazw] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {CZ9Bazw}{CZ9BazwrTaOVCF43VTFwSw}{1banlZ90TXmtGKYtbglMHw}{10.249.186.101}{10.249.186.101:9300}{ml.machine_memory=4025565184, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-07-12T10:41:40,652][INFO ][o.e.c.s.ClusterApplierService] [CZ9Bazw] new_master {CZ9Bazw}{CZ9BazwrTaOVCF43VTFwSw}{1banlZ90TXmtGKYtbglMHw}{10.249.186.101}{10.249.186.101:9300}{ml.machine_memory=4025565184, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {CZ9Bazw}{CZ9BazwrTaOVCF43VTFwSw}{1banlZ90TXmtGKYtbglMHw}{10.249.186.101}{10.249.186.101:9300}{ml.machine_memory=4025565184, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-07-12T10:41:40,678][INFO ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [CZ9Bazw] publish_address {10.249.186.101:9200}, bound_addresses {[::]:9200}

Is that all the logs?