Cum să instalați și să configurați Elasticsearch în mediul dvs. de dezvoltare/producție?
Publicat: 2019-12-29 În acest tutorial vom trece peste pașii despre cum să instalați și să configurați Elasticsearch
pentru mediul dvs. de dezvoltare și producție.
Ce este ElasticSearch?
Unul dintre cele mai bune motoare de căutare și analiză din lume. Elasticsearch este un motor distribuit, bazat pe JSON, proiectat pentru scalability
orizontală, reliability
maximă și gestionare ușoară.
Căutarea elastică stochează central datele dvs., astfel încât să puteți descoperi ceea ce este așteptat și să descoperi neașteptat. Puteți trimite toate jurnalele dvs. la ElasticSearch prin Filebeat și puteți vizualiza instantaneu valorile.
Dacă aveți oricare dintre întrebările de mai jos, vă aflați la locul potrivit:
- Cum se instalează și se configurează Elasticsearch pe Ubuntu 16.04
- Configurare și configurare Elasticsearch
- Instalarea și configurarea Elasticsearch
- Cum se instalează și se configurează o instanță Elasticsearch la distanță
Pasul 1) Instalați Elasticsearch
Iată câteva comenzi simple pentru a instala Elasticsearch pe sistemul de operare Linux/Ubuntu.
1 2 3 4 5 6 7 8 9 |
bash - 3.2 $ wget https : //artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz bash - 3.2 $ wget https : //artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz.sha512 bash - 3.2 $ shasum - a 512 - c elasticsearch - 6.7.0.tar.gz.sha512 bash - 3.2 $ tar - xzf elasticsearch - 6.7.0.tar.gz bash - 3.2 $ cd elasticsearch - 6.7.0 / |
Si asta e. Aici sunt jurnalele de instalare.
Jurnalele de instalare:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
crunch@localhost:/$ cd tmp/ crunch@localhost:/tmp$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz --2019-03-30 14:41:25-- https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz Resolving artifacts.elastic.co (artifacts.elastic.co)... 2a04:4e42:a::734, 151.101.42.222 Connecting to artifacts.elastic.co (artifacts.elastic.co)|2a04:4e42:a::734|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 149006122 (142M) [application/x-gzip] Saving to: ‘elasticsearch-6.7.0.tar.gz’ elasticsearch-6.7.0.tar.gz 100%[=========================================================================>] 142.10M 215MB/s in 0.7s 2019-03-30 14:41:26 (215 MB/s) - ‘elasticsearch-6.7.0.tar.gz’ saved [149006122/149006122] crunch@localhost:/tmp$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz.sha512 --2019-03-30 14:41:26-- https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz.sha512 Resolving artifacts.elastic.co (artifacts.elastic.co)... 2a04:4e42:a::734, 151.101.42.222 Connecting to artifacts.elastic.co (artifacts.elastic.co)|2a04:4e42:a::734|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 156 [application/octet-stream] Saving to: ‘elasticsearch-6.7.0.tar.gz.sha512’ elasticsearch-6.7.0.tar.gz.sha512 100%[=========================================================================>] 156 --.-KB/s in 0s 2019-03-30 14:41:26 (24.2 MB/s) - ‘elasticsearch-6.7.0.tar.gz.sha512’ saved [156/156] crunch@localhost:/tmp$ shasum -a 512 -c elasticsearch-6.7.0.tar.gz.sha512 elasticsearch-6.7.0.tar.gz: OK crunch@localhost:/tmp$ tar -xzf elasticsearch-6.7.0.tar.gz crunch@localhost:/tmp$ cd elasticsearch-6.7.0/ crunch@localhost:/tmp/elasticsearch-6.7.0$ ./bin/elasticsearch warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. OpenJDK 64-Bit Server VM warning: UseAVX=2 is not supported on this CPU, setting it to UseAVX=1 [2019-03-30T14:42:15,073][INFO ][o.e.e.NodeEnvironment ] [ZKsMkES] using [1] data paths, mounts [[/ (/dev/sda)]], net usable_space [69.8gb], net total_space [78.2gb], types [ext4] [2019-03-30T14:42:15,079][INFO ][o.e.e.NodeEnvironment ] [ZKsMkES] heap size [1007.3mb], compressed ordinary object pointers [true] [2019-03-30T14:42:15,084][INFO ][o.e.n.Node ] [ZKsMkES] node name derived from node ID [ZKsMkESwRL27iYEKUaBluQ]; set [node.name] to override [2019-03-30T14:42:15,084][INFO ][o.e.n.Node ] [ZKsMkES] version[6.7.0], pid[20094], build[default/tar/8453f77/2019-03-21T15:32:29.844721Z], OS[Linux/4.18.0-13-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11.0.1/11.0.1+13-Ubuntu-3ubuntu3.18.10.1] [2019-03-30T14:42:15,084][INFO ][o.e.n.Node ] [ZKsMkES] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -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-6051013812527326393, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -XX:UseAVX=2, -Des.path.home=/tmp/elasticsearch-6.7.0, -Des.path.conf=/tmp/elasticsearch-6.7.0/config, -Des.distribution.flavor=default, -Des.distribution.type=tar] [2019-03-30T14:42:17,459][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [aggs-matrix-stats] [2019-03-30T14:42:17,460][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [analysis-common] [2019-03-30T14:42:17,460][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [ingest-common] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [ingest-geoip] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [ingest-user-agent] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [lang-expression] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [lang-mustache] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [lang-painless] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [mapper-extras] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [parent-join] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [percolator] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [rank-eval] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [reindex] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [repository-url] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [transport-netty4] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [tribe] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-ccr] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-core] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-deprecation] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-graph] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-ilm] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-logstash] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-ml] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-monitoring] [2019-03-30T14:42:17,496][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-rollup] [2019-03-30T14:42:17,497][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-security] [2019-03-30T14:42:17,497][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-sql] [2019-03-30T14:42:17,498][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-upgrade] [2019-03-30T14:42:17,499][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-watcher] [2019-03-30T14:42:17,499][INFO ][o.e.p.PluginsService ] [ZKsMkES] no plugins loaded [2019-03-30T14:42:22,899][INFO ][o.e.x.s.a.s.FileRolesStore] [ZKsMkES] parsed [0] roles from file [/tmp/elasticsearch-6.7.0/config/roles.yml] [2019-03-30T14:42:24,035][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [ZKsMkES] [controller/20173] [Main.cc@109] controller (64 bit): Version 6.7.0 (Build d74ae2ac01b10d) Copyright (c) 2019 Elasticsearch BV [2019-03-30T14:42:24,565][DEBUG][o.e.a.ActionModule ] [ZKsMkES] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security [2019-03-30T14:42:24,896][INFO ][o.e.d.DiscoveryModule ] [ZKsMkES] using discovery type [zen] and host providers [settings] [2019-03-30T14:42:25,908][INFO ][o.e.n.Node ] [ZKsMkES] initialized [2019-03-30T14:42:25,908][INFO ][o.e.n.Node ] [ZKsMkES] starting ... [2019-03-30T14:42:26,087][INFO ][o.e.t.TransportService ] [ZKsMkES] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300} [2019-03-30T14:42:26,128][WARN ][o.e.b.BootstrapChecks ] [ZKsMkES] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] [2019-03-30T14:42:29,217][INFO ][o.e.c.s.MasterService ] [ZKsMkES] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {ZKsMkES}{ZKsMkESwRL27iYEKUaBluQ}{YYShNSkJT7Ctc-LFBTrO8w}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4136235008, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} [2019-03-30T14:42:29,226][INFO ][o.e.c.s.ClusterApplierService] [ZKsMkES] new_master {ZKsMkES}{ZKsMkESwRL27iYEKUaBluQ}{YYShNSkJT7Ctc-LFBTrO8w}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4136235008, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {ZKsMkES}{ZKsMkESwRL27iYEKUaBluQ}{YYShNSkJT7Ctc-LFBTrO8w}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4136235008, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]]) [2019-03-30T14:42:29,315][INFO ][o.e.h.n.Netty4HttpServerTransport] [ZKsMkES] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200} [2019-03-30T14:42:29,316][INFO ][o.e.n.Node ] [ZKsMkES] started [2019-03-30T14:42:29,322][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [ZKsMkES] Failed to clear cache for realms [[]] [2019-03-30T14:42:29,404][INFO ][o.e.g.GatewayService ] [ZKsMkES] recovered [0] indices into cluster_state [2019-03-30T14:42:29,692][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.watches] for index patterns [.watches*] [2019-03-30T14:42:29,730][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.triggered_watches] for index patterns [.triggered_watches*] [2019-03-30T14:42:29,783][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.watch-history-9] for index patterns [.watcher-history-9*] [2019-03-30T14:42:29,818][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-6-*] [2019-03-30T14:42:29,866][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-es] for index patterns [.monitoring-es-6-*] [2019-03-30T14:42:29,892][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-alerts] for index patterns [.monitoring-alerts-6] [2019-03-30T14:42:29,957][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-beats] for index patterns [.monitoring-beats-6-*] [2019-03-30T14:42:29,991][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-6-*] [2019-03-30T14:42:30,116][INFO ][o.e.l.LicenseService ] [ZKsMkES] license [319113dd-7fb5-4ae5-8355-e2c7458b1532] mode [basic] - valid |
Pasul 2) Începeți procesul Elasticsearch
Trebuie să vă asigurați că JAVA_HOME este configurat corect.
1 2 3 |
crunch @ localhost : / usr / lib / jvm / java - 11 - openjdk - amd64 / bin $ export JAVA_HOME =/ usr / lib / jvm / java - 11 - openjdk - amd64 / bin / crunch @ localhost : / usr / lib / jvm / java - 11 - openjdk - amd64 / bin $ echo $ JAVA_HOME / usr / lib / jvm / java - 11 - openjdk - amd64 / bin / |
Porniți comanda procesului ElasticSearch:
1 |
. / bin / elasticsearch |
Asigurați-vă că trebuie să porniți Elastic Search folosind normal user
. ElasticSearch nu va porni ca root user
și veți vedea eroarea de mai jos dacă încercați să-l rulați ca utilizator root.
1 |
java . lang . RuntimeException : can not run elasticsearch as root |
Urmați acest tutorial despre cum să adăugați un utilizator non-root și să vă conectați.
Iată o ieșire a rezultatului consolei:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
crunch@localhost:/tmp/elasticsearch-6.7.0$ ./bin/elasticsearch warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. OpenJDK 64-Bit Server VM warning: UseAVX=2 is not supported on this CPU, setting it to UseAVX=1 [2019-03-30T14:42:15,073][INFO ][o.e.e.NodeEnvironment ] [ZKsMkES] using [1] data paths, mounts [[/ (/dev/sda)]], net usable_space [69.8gb], net total_space [78.2gb], types [ext4] [2019-03-30T14:42:15,079][INFO ][o.e.e.NodeEnvironment ] [ZKsMkES] heap size [1007.3mb], compressed ordinary object pointers [true] [2019-03-30T14:42:15,084][INFO ][o.e.n.Node ] [ZKsMkES] node name derived from node ID [ZKsMkESwRL27iYEKUaBluQ]; set [node.name] to override [2019-03-30T14:42:15,084][INFO ][o.e.n.Node ] [ZKsMkES] version[6.7.0], pid[20094], build[default/tar/8453f77/2019-03-21T15:32:29.844721Z], OS[Linux/4.18.0-13-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11.0.1/11.0.1+13-Ubuntu-3ubuntu3.18.10.1] [2019-03-30T14:42:15,084][INFO ][o.e.n.Node ] [ZKsMkES] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -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-6051013812527326393, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -XX:UseAVX=2, -Des.path.home=/tmp/elasticsearch-6.7.0, -Des.path.conf=/tmp/elasticsearch-6.7.0/config, -Des.distribution.flavor=default, -Des.distribution.type=tar] [2019-03-30T14:42:17,459][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [aggs-matrix-stats] [2019-03-30T14:42:17,460][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [analysis-common] [2019-03-30T14:42:17,460][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [ingest-common] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [ingest-geoip] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [ingest-user-agent] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [lang-expression] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [lang-mustache] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [lang-painless] [2019-03-30T14:42:17,487][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [mapper-extras] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [parent-join] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [percolator] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [rank-eval] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [reindex] [2019-03-30T14:42:17,488][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [repository-url] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [transport-netty4] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [tribe] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-ccr] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-core] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-deprecation] [2019-03-30T14:42:17,489][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-graph] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-ilm] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-logstash] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-ml] [2019-03-30T14:42:17,490][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-monitoring] [2019-03-30T14:42:17,496][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-rollup] [2019-03-30T14:42:17,497][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-security] [2019-03-30T14:42:17,497][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-sql] [2019-03-30T14:42:17,498][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-upgrade] [2019-03-30T14:42:17,499][INFO ][o.e.p.PluginsService ] [ZKsMkES] loaded module [x-pack-watcher] [2019-03-30T14:42:17,499][INFO ][o.e.p.PluginsService ] [ZKsMkES] no plugins loaded [2019-03-30T14:42:22,899][INFO ][o.e.x.s.a.s.FileRolesStore] [ZKsMkES] parsed [0] roles from file [/tmp/elasticsearch-6.7.0/config/roles.yml] [2019-03-30T14:42:24,035][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [ZKsMkES] [controller/20173] [Main.cc@109] controller (64 bit): Version 6.7.0 (Build d74ae2ac01b10d) Copyright (c) 2019 Elasticsearch BV [2019-03-30T14:42:24,565][DEBUG][o.e.a.ActionModule ] [ZKsMkES] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security [2019-03-30T14:42:24,896][INFO ][o.e.d.DiscoveryModule ] [ZKsMkES] using discovery type [zen] and host providers [settings] [2019-03-30T14:42:25,908][INFO ][o.e.n.Node ] [ZKsMkES] initialized [2019-03-30T14:42:25,908][INFO ][o.e.n.Node ] [ZKsMkES] starting ... [2019-03-30T14:42:26,087][INFO ][o.e.t.TransportService ] [ZKsMkES] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300} [2019-03-30T14:42:26,128][WARN ][o.e.b.BootstrapChecks ] [ZKsMkES] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] [2019-03-30T14:42:29,217][INFO ][o.e.c.s.MasterService ] [ZKsMkES] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {ZKsMkES}{ZKsMkESwRL27iYEKUaBluQ}{YYShNSkJT7Ctc-LFBTrO8w}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4136235008, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} [2019-03-30T14:42:29,226][INFO ][o.e.c.s.ClusterApplierService] [ZKsMkES] new_master {ZKsMkES}{ZKsMkESwRL27iYEKUaBluQ}{YYShNSkJT7Ctc-LFBTrO8w}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4136235008, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {ZKsMkES}{ZKsMkESwRL27iYEKUaBluQ}{YYShNSkJT7Ctc-LFBTrO8w}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4136235008, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]]) [2019-03-30T14:42:29,315][INFO ][o.e.h.n.Netty4HttpServerTransport] [ZKsMkES] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200} [2019-03-30T14:42:29,316][INFO ][o.e.n.Node ] [ZKsMkES] started [2019-03-30T14:42:29,322][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [ZKsMkES] Failed to clear cache for realms [[]] [2019-03-30T14:42:29,404][INFO ][o.e.g.GatewayService ] [ZKsMkES] recovered [0] indices into cluster_state [2019-03-30T14:42:29,692][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.watches] for index patterns [.watches*] [2019-03-30T14:42:29,730][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.triggered_watches] for index patterns [.triggered_watches*] [2019-03-30T14:42:29,783][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.watch-history-9] for index patterns [.watcher-history-9*] [2019-03-30T14:42:29,818][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-6-*] [2019-03-30T14:42:29,866][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-es] for index patterns [.monitoring-es-6-*] [2019-03-30T14:42:29,892][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-alerts] for index patterns [.monitoring-alerts-6] [2019-03-30T14:42:29,957][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-beats] for index patterns [.monitoring-beats-6-*] [2019-03-30T14:42:29,991][INFO ][o.e.c.m.MetaDataIndexTemplateService] [ZKsMkES] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-6-*] [2019-03-30T14:42:30,116][INFO ][o.e.l.LicenseService ] [ZKsMkES] license [319113dd-7fb5-4ae5-8355-e2c7458b1532] mode [basic] - valid |

Pasul 3) Verificați procesul Elasticsearchprocess
Cum să vă asigurați că Elasticsearch rulează?
command:
ps -few | grep elastic
1 2 3 4 |
crunch @ localhost : / tmp / elasticsearch - 6.7.0 $ ps - few | grep elastic crunch 20305 1 99 14 : 46 pts / 0 00 : 00 : 28 / usr / bin / java - Xms1g - Xmx1g - XX : + UseConcMarkSweepGC - XX : CMSInitiatingOccupancyFraction = 75 - XX : + UseCMSInitiatingOccupancyOnly - Des . networkaddress . cache . ttl = 60 - Des . networkaddress . cache . negative . ttl = 10 - 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 - 5628366226360196103 - XX : + HeapDumpOnOutOfMemoryError - XX : HeapDumpPath = data - XX : ErrorFile = logs / hs_err_pid % p . log - Xlog : gc* , gc + age = trace , safepoint : file = logs / gc . log : utctime , pid , tags : filecount = 32 , filesize = 64m - Djava . locale . providers = COMPAT - XX : UseAVX = 2 - Des . path . home =/ tmp / elasticsearch - 6.7.0 - Des . path . conf =/ tmp / elasticsearch - 6.7.0 / config - Des . distribution . flavor = default - Des . distribution . type = tar - cp / tmp / elasticsearch - 6.7.0 / lib /* org . elasticsearch . bootstrap . Elasticsearch - d crunch 20320 20305 0 14 : 46 pts / 0 00 : 00 : 00 / tmp / elasticsearch - 6.7.0 / modules / x - pack - ml / platform / linux - x86_64 / bin / controller crunch 20362 20062 0 14 : 46 pts / 0 00 : 00 : 00 grep -- color = auto elastic |
Asta e. Sunteți gata să rulați ElasticSearch.
Fișierul implicit de pornire elasticsearch:
1 2 3 4 |
crunch @ localhost : / tmp / elasticsearch - 6.7.0 / bin $ pwd / tmp / elasticsearch - 6.7.0 / bin crunch @ localhost : / tmp / elasticsearch - 6.7.0 / bin $ vi elasticsearch |
conținutul fișierului elasticsearch:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
source "`dirname " $ 0 "`" / elasticsearch - env ES_JVM_OPTIONS = "$ES_PATH_CONF" / jvm . options JVM_OPTIONS = ` "$JAVA" - cp "$ES_CLASSPATH" org . elasticsearch . tools . launchers . JvmOptionsParser "$ES_JVM_OPTIONS" ` ES_JAVA_OPTS = "${JVM_OPTIONS//\$\{ES_TMPDIR\}/$ES_TMPDIR} $ES_JAVA_OPTS" cd "$ES_HOME" # manual parsing to find out, if process should be detached if ! echo $ * | grep - E '(^-d |-d$| -d |--daemonize$|--daemonize )' > / dev / null ; then exec \ "$JAVA" \ $ ES_JAVA_OPTS \ - Des . path . home = "$ES_HOME" \ - Des . path . conf = "$ES_PATH_CONF" \ - Des . distribution . flavor = "$ES_DISTRIBUTION_FLAVOR" \ - Des . distribution . type = "$ES_DISTRIBUTION_TYPE" \ - cp "$ES_CLASSPATH" \ org . elasticsearch . bootstrap . Elasticsearch \ "$@" else exec \ "$JAVA" \ $ ES_JAVA_OPTS \ - Des . path . home = "$ES_HOME" \ - Des . path . conf = "$ES_PATH_CONF" \ - Des . distribution . flavor = "$ES_DISTRIBUTION_FLAVOR" \ - Des . distribution . type = "$ES_DISTRIBUTION_TYPE" \ - cp "$ES_CLASSPATH" \ org . elasticsearch . bootstrap . Elasticsearch \ "$@" \ < &- & retval=$? pid=$! [ $retval -eq 0 ] || exit $retval if [ ! -z "$ES_STARTUP_SLEEP_TIME" ]; then sleep $ ES_STARTUP_SLEEP_TIME fi if ! ps - p $ pid > / dev / null ; then exit 1 fi exit 0 fi exit $ ? |
Ce urmeaza? Configurați Filebeat.
Cum se instalează și se configurează Filebeat? Redirecționer ușor de jurnal pentru mediu de dezvoltare/producere