🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 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: 节点标识