Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

CentOS下ElasticSearch快速安装

安装ElasticSearch

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0.tar.gz
tar -zxf elasticsearch-7.2.0.tar.gz -C /usr/local/
mv /usr/local/elasticsearch-7.2.0 /usr/local/elasticsearch

创建es用户

groupadd es
useradd -g es -M -s /sbin/nologin es
chown -R es:es /usr/local/elasticsearch/
cd /usr/local/elasticsearch

配置环境

修改config/jvm.options为内存的一半大小:vim config/jvm.options

-Xms512m
-Xmx512m

修改max filemax virtual memory参数,使用root或sudo用户:vim /etc/sysctl.conf,添加下面配置:

vm.max_map_count=655360

并执行命令:sysctl -p

配置文件

配置端口及跨域

vim /usr/local/elasticsearch-7.2.0/config/elasticsearch.yml
cluster.name: elasticsearch
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
node.max_local_storage_nodes: 2
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true

安装插件

切换es用户,在Elasticsearch主目录下运行下列命令来安装插件

su - es
bin/elasticsearch-plugin install xxx

启动ES

es用户启动

/usr/local/elasticsearch-7.2.0/bin/elasticsearch -d

root用户启动

su - es -c '/usr/local/elasticsearch-7.2.0/bin/elasticsearch -d'
上一篇 使用yum安装配置ElasticSearch
下一篇 CentOS下搭建Shadowsocks服务器