EverKB

Knowledge Base Ever

Installer Elasticsearch 7.3 på CentOS7

2020-01-14 15:52:48

tag: CentOS, Elasticsearch, CentOS7, Elasticsearch7.3, Installer Elasticsearch, den officielle Elasticsearch

Rediger filen /etc/yum.repos.d/elasticsearch.repo som følger:

[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

Efter YUM-installationen skal du indstille boot-operationen og starte tjenesten.

yum -y install elasticsearch

systemctl daemon-reload
systemctl enable elasticsearch
systemctl start elasticsearch

Rediger konfigurationsfilen /etc/elasticsearch/elasticsearch.yml

Tilføj en autoriseringsaktiveret konfiguration under linjen #secruity, gem og afslutt
network.host: 192.168.0.10

http.port: 9200

cluster.initial_master_nodes: ["node-1"]

Genstart elasticsearch, og du kan bruge klienten til at oprette forbindelse på afstand.

[root@localhost ~]# systemctl restart elasticsearch

[root@localhost ~]# curl 192.168.0.10:9200
{
  "name" : "carbon",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "RmfeiseHQ8C5S9eF7gG6aQ",
  "version" : {
    "number" : "7.3.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "de777fa",
    "build_date" : "2019-07-24T18:30:11.767338Z",
    "build_snapshot" : false,
    "lucene_version" : "8.1.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
[root@carbon ~]#

Problem: Efter opsætning af godkendelsesverifikation etableres brugeren og adgangskoden også, men klienten kan ikke oprette forbindelse.

Løsning: Stop firewall
systemctl stop firewalld
systemctl stop iptables

Spørgsmål: Spørg, når du får adgang til ElasticSearch: Elasticsearch cluster 'master_not_discovered_exception'

Løsning: Dette problem blev fundet ved installation af Elasticsearch 7.5 i CentOS8. Årsagen er, at noder ikke kan finde hinanden. Hvis der kun er en knude, kan du ændre konfigurationsfilen og indstille nodenavnet til node-1.

Det anbefales at indstille feltcache-størrelsen til 50% af den aktuelle hukommelse.
vim /etc/elasticsearch/elasticsearch.yml

node.name: node-1

indices.fielddata.cache.size: 2gb

tag

CentOS7 CentOS PHP Linux Python Python3 MySQL MariaDB YUM JavaScript mysql_native_password PHP7 CSS Redis MySQL8 caching_sha2_password HTML substr Bluetooth Failed to build these modules: _ctypes Minimal ISO Wi-Fi date sub INTERVAL PECL SQL Date Funcitons Tag Cloud CodeIgniter font-size root apache httpd dual network interfaces Laravel ss5 vertical-align CURLFille horiz-align node.js ShadowsocksR BarManager exec mb_substr PyCharm SUBDATE WebStorm date add IntelliJIDEA PEAR SOCKS5 Proxy Server Tag Chrome find remi Apache du jQuery PHP5.5 src V2Ray cURL hide nginx Shadowsocks-Python availability eth0 MariaDB10.4 PostgreSQL sub folder Web Server date Install MongoDB pdo_sqlsrv SOCKS5 Symfony File Upload mssql-tools register_shutdown_function Zend Framework ADDDATE DevExpress JetBrain php-fpm sqlsrv unixODBC-devel height network interface Shadowsocks-Libev Aura error_get_last Port 80 string Web Development data INDENTIFIED BY password policy requirements SOCKS SVN Fedora Media Writer msodbcsql Redis5 absolute Deepin jemalloc SQLAlchemy toggle convert FuelPHP mysqlclient Shadowsocks at-symbol Error Control Operator margin PHPUnit Framework ss5.passwd vps daemon process IIS password SOCKET sudoers center Fatal Errors MongoDB4 WiFi .htaccess DATE_SUB Phalcon SQL Server 2017 TestCase Compiling PHP frequency conflict set_error_handler apr Elasticsearch7.3 PHPUnit ss5.conf Vincent Garreau daemon HTTP particles.js Slim Sudo Failed to build these modules: _uuid MongoDB width DATE_ADD ip command pg_bha.conf SQL Server Tcp BBR Compiling Apache Frameworks MySQL-python scrollbar Apache2.4 Elasticsearch libpython3.7m.so.1.0 PHPStorm ss5-3.8.9 VIM CURLOPT_POSTFIELDS NodeJs show