1. 集群环境及安装包
1.1. 集群环境
主机名 | IP | 系统版本 | 部署服务 |
---|---|---|---|
hadoop32 | 192.168.0.32 | CentOS6.5_64 | ES Node |
hadoop33 | 192.168.0.33 | CentOS6.5_64 | ES Node |
hadoop34 | 192.168.0.34 | CentOS6.5_64 | ES Node |
1.2. 准备安装包
包名 | 下载地址 |
---|---|
elasticsearch-7.3.2-linux-x86_64.tar.gz | https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.3.tar.gz |
git | yum install -y git |
elasticsearch-head | git clone git://github.com/mobz/elasticsearch-head.git |
node-v4.9.1-linux-x64.tar.gz | https://npm.taobao.org/mirrors/node/latest-v4.x/ |
2. 配置
2.1. 准备数据目录、日志目录
1 2 3 |
mkdir -p /data/es/data mkdir -p /data/es/logs |
2.2. es用户及组权限配置
1 2 3 4 5 |
groupadd elsearch useradd elsearch -g elsearch chown -R elsearch:elsearch /opt/elasticsearch chown -R elsearch:elsearch /data/ |
2.3. es相关配置
vi /opt/elasticsearch/conf/elasticsearch.yml
1 2 3 4 5 6 7 8 9 10 11 |
cluster.name: ES node.name: hadoop33 path.data: /data/es/data/ path.logs: /data/es/logs/ network.host: 0.0.0.0 discovery.zen.ping.unicast.hosts: ["hadoop32", "hadoop33", "hadoop34"] bootstrap.memory_lock: false bootstrap.system_call_filter: false http.cors.enabled: true http.cors.allow-origin: "*" |
vi /opt/elasticsearch/config/jvm.options
1 2 3 |
-Xms4g -Xmx4g |
2.4. 系统参数配置
2.4.1. 配置limits.conf,再底部添加下面内容:
vi /etc/security/limits.conf
1 2 3 4 5 |
* soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096 |
2.4.2. 配置90-nproc.conf
修改 nproc 1024 => 102400
vi /etc/security/limits.d/90-nproc.conf
1 2 |
* soft nproc 4096 |
2.4.3. 配置sysctl.conf,在底部添加如下内容
vi /etc/sysctl.conf
1 2 |
vm.max_map_count=655360 |
2.4.4. 刷新配置
sysctl -p
3. 启动es
su - elsearch
cd /opt/elasticsearch/
./bin/elasticsearch -d
4. 安装 elasticSearch-Head
4.1. 配置 nodejs
tar -xvf node-v4.9.1-linux-x64.tar.gz
mv node-v4.9.1-linux-x64 /opt/node
vi /etc/profile
1 2 3 4 |
export JAVA_HOME=/opt/tools/java export NODE_HOME=/opt/node export PATH=.:$PATH:$JAVA_HOME/bin:$NODE_HOME/bin |
检查是否安装成功
1 2 3 4 5 |
[root@hadoop33 elasticsearch-head]# source /etc/profile [root@hadoop33 elasticsearch-head]# node -v v4.9.1 [root@hadoop33 elasticsearch-head]# |
4.2. npm 编译ElasticSearch-head
4.2.1. 设置淘宝仓库
1 2 3 4 |
npm install -g cnpm --registry=https://registry.npm.taobao.org npm install -g grunt-cli npm install grunt --save-dev |
1 2 3 4 5 |
git clone git://github.com/mobz/elasticsearch-head.git cd elasticsearch-head/ npm install grunt --save-dev cnpm install |
4.3. 配置 Elasticsearch-head
vi Gruntfile.js
增加 hostname
1 2 3 4 5 6 7 8 9 10 11 |
connect: { server: { options: { hostname:'0.0.0.0', port: 9100, base: '.', keepalive: true } } } |
vi _site/app.js
修改 http://localhost:9200
为 es 的某个节点
1 2 |
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://hadoop33:9200"; |
4.4. 启动 Elasticsearch-head
node_modules/grunt/bin/grunt server
或者 npm run start
原创文章,转载请注明: 转载自LoserZhao – 诗和远方[ http://www.loserzhao.com/ ]
本文链接地址: http://www.loserzhao.com/bigdata/elasticsearch-6-8-3-for-centos6-5-install.html
文章的脚注信息由WordPress的wp-posturl插件自动生成
0 条评论。