#下载
wget https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz
#解压缩
tar xf node-v10.15.3-linux-x64.tar.xz -C ../servers
#进入解压目录
cd node-v10.15.3-linux-x64/
#执行node命令 查看版本
/bin/node -v
v10.15.3
解压文件的 bin 目录底下包含了 node、npm 等命令,我们可以使用 ln 命令来设置软连接:
ln -s /opt/lagou/servers/node-v10.15.3-linux-x64/bin/npm /usr/local/bin/
ln -s /opt/lagou/servers/node-v10.15.3-linux-x64/bin/node /usr/local/bin/
2. phantomjs安装配置
cd /usr/local
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-
x86_64.tar.bz2
#注意安装
yum install -y bzip2
tar -jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2
vim /etc/profile
export PATH=$PATH:/usr/local/phantomjs-2.1.1-linux-x86_64/bin
#注意环境变量$Path移动在最前面
source /etc/profile
3. elasticsearch-head安装
npm install -g grunt-cli
npm install grunt
npm install grunt-contrib-clean
npm install grunt-contrib-concat
npm install grunt-contrib-watch
npm install grunt-contrib-connect
yum -y install git
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install -g cnpm --registry=https://registry.npm.taobao.org
4. elasticsearch-head发现主机 并连接 elasticsearch.yml配置文件修改:
如果之前设置过 可以忽略这一步
http.cors.enabled: true
http.cors.allow-origin: "*"