重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
配置新服务器的系统环境,与旧 Ambari-Server 节点服务器一致;
主要有以下几个方面:
1、基础系统依赖;
/usr/bin/yum install zlib zlib-devel libjpeg libjpeg-devel libpng libpng-devel gd gd-devel curl curl-devel freetype freetype-devel libxslt libxslt-devel libxml2 libxml2-devel ncurses ncurses-devel gcc gcc-c++ flex flex-devel libtiff-devel pam-devel libffi-devel e2fsprogs-devel openssl* ntpdate tree autoconf lrzsz uuid dstat bind-utils vim rsync net-tools wget -y
2、Ambari Yum 源配置,/etc/yum.repo.d/ambari.repo;
3、配置新服务器对 Ambari 管理的所有集群节点的 SSH 免密认证;
4、Java 运行环境;JDK 的版本及安装路径,环境变量必须一致;
5、Python 运行环境;
1)/usr/bin/yum install python-setuptools python-devel -y
2)pip install psutil (也可以下载 psutil 依赖模块安装包进行安装)
6、安装数据库(如果不需要迁移数据库,这一步不需要)
1)yum install mariadb-server mariadb -y;
2)下载 JDBC Driver,存放至 /usr/share/java;
3)创建 ambari 数据库并授权;
7、同步主机 /etc/hosts 文件;
yum install ambari-server -y
ambari-server setup
MySQL -uambari -p123456 -D ambari
/etc/init.d/ambari-server stop
mysqldump -uambari -p123456 -B ambari >ambari.sql
scp ambari.sql new-ambari-server-node:~/
mysql -uambari -p123456
/etc/init.d/ambari-server start
sed -i 's/hostname=old-ambari-server/hostname=new-ambari-server/' /etc/ambari-agent/conf/ambari-agent.ini
for n in `node-list`;do scp /etc/ambari-agent/conf/ambari-agent.ini $n:etc/ambari-agent/conf/;done
for n in `node-list`;do ssh $n "/etc/init.d/ambari-agent restart";done