Daftar Isi:

jika opensearch tidak running dan muncul error seperti berikut:

Source Code

changes documentation for the next major version.
[2024-09-09T06:44:39,155][INFO ][o.o.a.b.ADCircuitBreakerService] [opensearch-node1] Registered memory breaker.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.protostuff.runtime.PolymorphicThrowableSchema (file:/usr/share/opensearch/plugins/opensearch-anomaly-detection/protostuff-runtime-1.7.4.jar) to field java.lang.Throwable.cause
WARNING: Please consider reporting this to the maintainers of io.protostuff.runtime.PolymorphicThrowableSchema
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[2024-09-09T06:44:39,571][INFO ][o.o.t.NettyAllocator     ] [opensearch-node1] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={opensearch.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
[2024-09-09T06:44:39,621][INFO ][o.o.d.DiscoveryModule    ] [opensearch-node1] using discovery type [zen] and seed hosts providers [settings]
[2024-09-09T06:44:39,907][WARN ][o.o.g.DanglingIndicesState] [opensearch-node1] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2024-09-09T06:44:40,123][INFO ][o.o.p.h.c.PerformanceAnalyzerConfigAction] [opensearch-node1] PerformanceAnalyzer Enabled: false
[2024-09-09T06:44:40,164][INFO ][o.o.n.Node               ] [opensearch-node1] initialized
[2024-09-09T06:44:40,164][INFO ][o.o.n.Node               ] [opensearch-node1] starting ...
[2024-09-09T06:44:40,252][INFO ][o.o.t.TransportService   ] [opensearch-node1] publish_address {172.20.0.3:9300}, bound_addresses {0.0.0.0:9300}
[2024-09-09T06:44:40,397][INFO ][o.o.b.BootstrapChecks    ] [opensearch-node1] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: OpenSearch did not exit normally - check the logs at /usr/share/opensearch/logs/opensearch-cluster.log
[2024-09-09T06:44:40,402][INFO ][o.o.n.Node               ] [opensearch-node1] stopping ...
[2024-09-09T06:44:40,415][INFO ][o.o.n.Node               ] [opensearch-node1] stopped
[2024-09-09T06:44:40,415][INFO ][o.o.n.Node               ] [opensearch-node1] closing ...
[2024-09-09T06:44:40,424][INFO ][o.o.n.Node               ] [opensearch-node1] closed
Killing performance analyzer process 34
OpenSearch exited with code 78
Performance analyzer exited with code 143

pertama jalankan

Source Code

sysctl vm.max_map_count

Tingkatkan nilai vm.max_map_count menjadi 262144 untuk memenuhi syarat minimum dari OpenSearch: Jalankan perintah berikut untuk sementara waktu meningkatkan nilai (hingga sistem di-restart):

Source Code

sudo sysctl -w vm.max_map_count=262144

Agar perubahan ini bersifat permanen, kamu bisa menambahkan konfigurasi ini ke file /etc/sysctl.conf. Tambahkan baris berikut:

Source Code

vm.max_map_count=262144

Verifikasi perubahan: Setelah menambahkan nilai ini ke sysctl.conf, jalankan perintah ini untuk memastikan pengaturan diterapkan:

Source Code

sudo sysctl -p