怎樣優(yōu)化網(wǎng)站渠道推廣有哪些方式
安裝elasticsearch
rpm包安裝
下載地址
https://mirrors.aliyun.com/elasticstack/7.x/yum/7.10.2/
生成證書
#1.生成CA證書
# 生成CA證書,執(zhí)行命令后,系統(tǒng)還會提示你輸入密碼,可以直接留空
cd /usr/share/elasticsearch/bin
./elasticsearch-certutil ca#會在/usr/share/elasticsearch/下生成一個elastic-stack-ca.p12文件
ls -l /usr/share/elasticsearch/
-rw-------. 1 elastic elastic 2527 May 21 14:29 elastic-stack-ca.p12#2.根據(jù)elastic-stack-ca.p12文件 生成elastic-certificates.p12
# 生成證書和私鑰,系統(tǒng)還會提示你輸入密碼,你可以輸入證書和密鑰的密碼,也可以留空
cd /usr/share/elasticsearch/
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
把生成的證書放到 /etc/elasticsearch/目錄下,并授權(quán)
不加認(rèn)證,啟動集群模式
egrep -v “#|^$” /etc/elasticsearch/elasticsearch.yml
cluster.name: es
node.name: es1
path.data: /app/es/data
path.logs: /app/es/log
network.host: 0.0.0.0
node.master: true
node.data: true
discovery.seed_hosts: ["172.17.13.10:9300", "172.17.13.11:9300", "172.17.13.12:9300"]
cluster.initial_master_nodes: ["es1", "es2", "es3"]
discovery.zen.minimum_master_nodes: 2
http.cors.enabled: true
http.cors.allow-origin: "*"
#xpack.security.enabled: true
#xpack.security.transport.ssl.enabled: true
#xpack.security.transport.ssl.verification_mode: certificate
#xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
#xpack.security.transport.ssl.truststore.path: elastic-stack-ca.p12
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
啟動集群,查看狀態(tài)
curl -XGET "http://127.0.0.1:9200/_cat/nodes"
添加認(rèn)證和證書,重啟集群
egrep -v “#|^$” /etc/elasticsearch/elasticsearch.yml
cluster.name: es
node.name: es1
path.data: /app/es/data
path.logs: /app/es/log
network.host: 0.0.0.0
node.master: true
node.data: true
discovery.seed_hosts: ["172.17.13.10:9300", "172.17.13.11:9300", "172.17.13.12:9300"]
#cluster.initial_master_nodes: ["es1", "es2", "es3"]
discovery.zen.minimum_master_nodes: 2
http.cors.enabled: true
http.cors.allow-origin: "*"
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-stack-ca.p12
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
設(shè)置口令
./bin/elasticsearch-setup-passwords interactive
查看集群信息
curl -XGET -u elastic:123456 "http://127.0.0.1:9200/_cluster/health?pretty"
curl -XGET -u elastic:123456 "http://127.0.0.1:9200/_cat/nodes"
kibana
vim /etc/kibana/kibana.yml
server.port: 5601
server.host: 0.0.0.0
elasticsearch.hosts: ["http://192.168.0.11:9200","http://192.168.0.12:9200","http://192.168.0.13:9200"]
xpack.security.enabled: true
kibana.index: ".kibana"
i18n.locale: "zh-CN"
elasticsearch.username: "elastic"
elasticsearch.password: "123456"