ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## rpm安装elasticsearch ### 导入PGP ~~~ rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch ~~~ ### 安装elasticsearch仓库 ~~~ vim elastic.repo ~~~ ~~~ [elasticsearch-5.x] name=Elasticsearch repository for 5.x packages baseurl=https://artifacts.elastic.co/packages/5.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md ~~~ ### 安装elasticsearch ~~~ yum install -y elasticsearch ~~~ ### 启动 ~~~ systemctl daemon-reload systemctl enable elasticsearch.service systemctl start elasticsearch.service ~~~ --- ## 下载安装 ### 下载并安装 ~~~ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz tar -xzf elasticsearch-5.4.0.tar.gz -C /usr/local/ ln -sv /usr/local/elasticsearch-5.4.0/ /usr/local/elasticsearch ~~~ ### 启动 ~~~ /usr/local/elasticsearch/bin/elasticsearch ~~~ ## 初步测试 #### elastic节点服务正常 ~~~ curl localhost:9200 ~~~ #### 获取节点索引 ~~~ curl -X GET 'localhost:9200/_cat/indices?v' ~~~ #### 集群服务正常 ~~~ curl 127.0.0.1:9200/_cluster/health?pretty ~~~ #### 查看集群node ~~~ curl -X GET 'http://192.168.101.223:9200/_cat/health?v' ~~~ ## 配置 /etc/elasticsearch/elasticsearch.yml ~~~ cluster.name: myes node.name: "m1.com" ~~~ cluster.name: elasticsearch集群的标识,拥有相同名称的节点在一个集群中 node.name: 节点标识