ES安装避坑-Windows成功安装ES实战
创始人
2025-06-01 04:19:44
0

一、下载地址

https://www.elastic.co/cn/elasticsearch

选择对应版本即可

二、配置操作

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
#network.host: 192.168.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# --------------------------------- Readiness ----------------------------------
#
# Enable an unauthenticated TCP readiness endpoint on localhost
#
#readiness.port: 9399
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically      
# generated to configure Elasticsearch security features on 21-03-2023 07:44:21
#
# --------------------------------------------------------------------------------# Enable security features
xpack.security.enabled: false xpack.security.enrollment.enabled: true# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:enabled: falsekeystore.path: certs/http.p12# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: certs/transport.p12truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["ZB-PF2G5QX1"]# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: 0.0.0.0# Allow other nodes to join the cluster from anywhere
# Connections are encrypted and mutually authenticated
#transport.host: 0.0.0.0#----------------------- END SECURITY AUTO CONFIGURATION -------------------------

其中注意点:

关闭密码验证:xpack.security.enabled: false

关闭SSL验证:

xpack.security.http.ssl:

enabled: false

keystore.path: certs/http.p12

三、验证

http://127.0.0.1:9200/

出现如下界面即可:

四、Python ES Demo示例

遍历Dataframe:

import pandas as pd

persons={'number':['小花','狗蛋','二狗','小草'],'crmFinalTag':[17,20,30,20],'crmFinalTagDesc':['女','男','男','女']}

df=pd.DataFrame(persons)

存入ES:

es.indices.create(index="tmp_crm_grade", ignore=400)

for index,row in df.iterrows():

data = {

"number": row['number'],

"crmFinalTag": row['crmFinalTag'],

"crmFinalTagDesc": row['crmFinalTagDesc']

} # 构建插入数据的结构

相关内容

热门资讯

“强实名”仍一票难求?遏制技术... 暑期来临,演唱会、音乐节、话剧等演出活动热度飙升。无论手速多快,总是一票难求,让众多消费者叫苦不迭。...
上证红利回报指数上涨0.83%... 金融界7月21日消息,上证指数高开高走,上证红利回报指数 (上红回报,H50019)上涨0.83%,...
为啥股票与基金的走势相反? 虚位以待! 平姐姐摄于毛里求斯网红酒店 昨天的文章,标题就很明确,那就是《准备出击》,在半年报不少上...
美加密货币相关法案落地引发三连... 当地时间7月18日,美国总统特朗普在白宫正式签署《指导与建立美国稳定币国家创新法案》(简称《天才法案...
股市必读:湖南黄金(00215... 截至2025年7月21日收盘,湖南黄金(002155)报收于18.33元,上涨2.57%,换手率3....
四川发布六大红色旅游新线路 四川发布六大红色旅游新线路 “锦绣天府·安逸四川”之红色旅游央地媒体联动采访启动 “锦绣天府·安...
北交所上市公司中航泰达大宗交易... 每经讯,2025年7月21日,北交所上市公司中航泰达(836263,收盘价:16.11元)发生一笔大...
金价突然猛拉,重回3400美元... 记者丨叶麦穗 编辑丨曾芳 金珊 7月21日晚,现货黄金突然猛拉大涨,截至22:40,涨超1.5%,站...
嘉实港股互联网产业核心资产混合... AI基金嘉实港股互联网产业核心资产混合A(011924)披露2025年二季报,第二季度基金利润532...
中信证券:特朗普“唱白脸”+贝... 来源:市场资讯 中信证券研究 文|李翀 崔嵘 韦昕澄 贾天楚 当地时间7月14日,美国总统特朗普表示...
机器人ETF易方达(15953... 截至收盘,国证机器人产业指数上涨2.1%,中证装备产业指数上涨1.9%,中证军工指数上涨0.9%,中...
北京工商大学教授吕来明:整治“... 今年以来,治理“内卷式”竞争引发高度关注。从水泥、光伏、汽车到电商,多个领域吹响“反内卷”的号角。 ...
民航局:加快新兴市场布局,提升... 7月21日,在国新办举行的“高质量完成‘十四五’规划”系列主题新闻发布会上,中国民航局局长宋志勇介绍...
二季度券商北交所、新三板业务执... 头部券商优势地位保持稳固,多家中小券商排名大幅跃升 本报记者 于宏 7月18日晚间,北交所、全国股转...
股票行情快报:美新科技(301... 证券之星消息,截至2025年7月21日收盘,美新科技(301588)报收于19.0元,上涨1.39%...
破解中小企业融资难!产业数字金... “中国经济的核心在于产业经济,产业经济离不开金融,产业经济、产业金融都离不开数字技术的赋能,中小企业...
京东美团“暗战”具身智能,战火... 在科技赛道的激烈角逐中,具身智能正成为巨头们争夺的新焦点。王兴之后,刘强东也在具身智能领域强势出击。...
“未来已来”指数涨跌不一,关注... 截至收盘,国证机器人产业指数上涨2.1%,中证新能源指数上涨1.5%,中证人工智能主题指数下跌0.0...
“未来能源”指数上涨,关注新能... 截至收盘,中证上海环交所碳中和指数上涨1.9%,中证光伏产业指数上涨1.6%,中证新能源指数上涨1....