腾讯云机器五台,分别是sehb1st、sehb2st、sehb3st、sehb4st、sehb5st,其中sehb1st作为master机,其它是client机
在 sehb1st 上生成 ssh 密钥:
ssh-keygen -t rsa
生成的密钥在~/.ssh文件夹下,将公钥 id_rsa.pub 中的内容拷贝到其它四台机器上~/.ssh/authorized_keys 文件中,然后执行:
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
把其它四台机器上 /etc/ssh/sshd_config 中的 PermitRootLogin no 改为 PermitRootLogin yes
测试 ssh sehb2st
可以成功登录
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm
rpm -ivh jdk-8u144-linux-x64.rpm
查看 java 版本 java -version
输出如下内容说明安装正确
openjdk version "1.8.0_141"
OpenJDK Runtime Environment (build 1.8.0_141-b16)
OpenJDK 64-Bit Server VM (build 25.141-b16, mixed mode)
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz
tar xvf apache-maven-3.5.0-bin.tar.gz
vi ~/.bashrc
添加 M2_HOME=/usr/local/apache-maven
export PATH=$PATH:$M2_HOME/bin
source ~/.bashrc
查看maven版本信息mvn -v
输出如下内容说明安装正确:
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /opt/maven/apache-maven-3.5.0
Java version: 1.8.0_141, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-1.b16.el7_3.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-514.21.2.el7.x86_64", arch: "amd64", family: "unix"
检测python 版本
python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
下载 setuptools-0.6c11-py2.7.egg ,然后执行sh setuptools-0.6c11-py2.7.egg
yum --enablerepo=updates-testing install rpm-build
yum install gcc-c++
wget https://nodejs.org/dist/v6.11.2/node-v6.11.2.tar.gz
tar xvf node-v6.11.2.tar.gz
./configure
make
make install
设置环境变量:
vi ~/.bashrc
添加 export PATH=/opt/maven/apache-maven-3.5.0/bin:$PATH
export PATH=/usr/local/bin:$PATH
source ~/.bashrc
npm install -g [email protected]
yum install -y git
yum install -y ant
yum install python-devel
wget http://www.apache.org/dist/ambari/ambari-2.5.1/apache-ambari-2.5.1-src.tar.gz
tar xfvz apache-ambari-2.5.1-src.tar.gz
cd apache-ambari-2.5.1-src
mvn versions:set -DnewVersion=2.5.1.0.0
pushd ambari-metrics
mvn versions:set -DnewVersion=2.5.1.0.0
popd
mvn -B clean install package rpm:rpm -DnewVersion=2.5.1.0.0 -DskipTests -Dpython.ver="python >= 2.6"
yum install ambari-server*.rpm
ambari-server setup
ambari-server start
yum install ambari-agent*.rpm
ambari-agent start
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.16:install-node-and-npm (install node and npm) on project ambari-admin: Could not extract the Node archive: Could not extract archive: ‘/root/.m2/repository/com/github/eirslett/yarn/0.23.2/yarn-0.23.2./yarn-v0.23.2.tar.gz
‘: EOFException -> [Help 1]
解决办法:将/root/.m2/repository/com/github/eirslett/yarn/0.23.2/yarn-0.23.2./yarn-v0.23.2.tar.gz删除,手动下载
Failed to execute goal on project ambari-metrics-storm-sink
解决办法:
vi /opt/ambari/apache-ambari-2.5.1-src/ambari-metrics/ambari-metrics-storm-sink/pom.xml
修改为如下