1、首先安装centos7.x版本操作系统,注意
这个地方要开启网络,我碰到过许多次这里不开启,最后只能访问内网,不能ping通外网,很坑爹,算是小坑点吧;
注意:操作系统所在的硬件资源里内存最好别太少了,建议可以的话4gb,应该基本够了,不过kettle跑起来难说会要更多;
2、配置ssh登录,
参照https://blog.csdn.net/qq_36663951/article/details/79813038;
首先yum install -y openssh-server;
来安装 openssh-server;
vi /etc/ssh/sshd_config
将 以下几行的注释取消:
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
PasswordAuthentication yes
:wq
保存文件退出;
systemctl enable sshd
systemctl start sshd
firewall-cmd --permanent --zone=public --add-port=22/tcp
firewall-cmd --reload
好了可以 ssh登录了;
3、由于kettle的部分功能需要gui,所以要配置远程登录centos7.x的gui环境,安装xrdp,安装完就可以用windows远程桌面来登录了 ;
1.默认库不包含xrdp,需要安装epel库。
yum install -y epel-release
然后安装xrdp
yum install -y xrdp
2.安装tigervnc-server
yum install -y tigervnc-server
3.为当前用户设置vnc密码,如果是其他用户,先su到这个用户,然后再vncpasswd。
vncpasswd root
4.配置xrdp.ini文件
vi /etc/xrdp/xrdp.ini
把max_bpp=32,改为max_bpp=24
5.配置selinux
chcon -t bin_t /usr/sbin/xrdp
chcon -t bin_t /usr/sbin/xrdp-sesman
6.启动xrdp服务,并设置为开机启动
systemctl start xrdp
systemctl enable xrdp
7.打开防火墙3389端口
firewall-cmd --permanent --zone=public --add-port=3389/tcp
firewall-cmd --reload
8.由于gui远程登录需要gui基础环境、gdm,所以安装gui环境、gdm;
yum groupinstall "Server with GUI";
systemctl start gdm;
注意: 如果起不来 那是虚拟机内存不够,关机加内存,一般到4gb 怎么都该够了,资源实在紧张的自己试最少能多少吧,别太少,否则远程的时候容易出问题
systemctl enable gdm;
到此xrdp安装完成,用rdp客户端,比如windows默认带的远程桌面就可以远程登录了;
可以参照 https://blog.csdn.net/shile/article/details/52223088;http://blog.csdn.net/txz317/article/details/51734222;
4、安装kettle:
参照https://www.linuxidc.com/Linux/2017-10/147656.htm;
1. 安装依赖环境:
首先kettle需要jdk环境支持,这里我安装openjdk:
yum install -y java-1.8.0-openjdk.x86_64;
然后安装一些杂项依赖:
yum -y install epel-release
yum -y install webkitgtk
注:这时候会发现没有这个包,因为centos7的相关软件源没有这个包,这时候可以:
参照:https://blog.csdn.net/yaoqiwaimai/article/details/77163261,来安装nux桌面相关软件包的一个专用软件源
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
再执行前面的安装就会成功了;
yum -y install redhat-lsb;
到这里一些依赖就安装完成了;
2. 接下来下载kettle,这里我依照同事要求下载的7.0版本:
创建目录并且下载;
mkdir /opt/kettle;cd /opt/kettle;
curl -O http://192.168.1.6/pdi-ce-7.0.0.0-25.zip
链接是我本地一台机器上现成下载好的,如果需要下载最新版本可以到:https://sourceforge.net/projects/pentaho/files/Data%20Integration/;
解压:
yum install -y unzip;
unzip pdi-ce-7.0.0.0-25.zip
cd data-integration/
赋予所有脚本执行权限:
chmod +x -R *.sh;
3、测试kettle的2个组件:
在命令行(哑终端比如ssh或者gui下的终端窗口都可以)作业执行器kitchen:
cd /opt/kettle/data-integration
[root@localhost data-integration]# ./kitchen.sh
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Options:
-rep = Repository name
-user = Repository username
-pass = Repository password
-job = The name of the job to launch
-dir = The directory (dont forget the leading /)
-file = The filename (Job XML) to launch
-level = The logging level (Basic, Detailed, Debug, Rowlevel, Error, Minimal, Nothing)
-logfile = The logging file to write to
-listdir = List the directories in the repository
-listjobs = List the jobs in the specified directory
-listrep = List the available repositories
-norep = Do not log into the repository
-version = show the version, revision and build date
-param = Set a named parameter <NAME>=<VALUE>. For example -param:FILE=customers.csv
-listparam = List information concerning the defined parameters in the specified job.
-export = Exports all linked resources of the specified job. The argument is the name of a ZIP file.
-custom = Set a custom plugin specific option as a String value in the job using <NAME>=<Value>, for example: -custom:COLOR=Red
-maxloglines = The maximum number of log lines that are kept internally by Kettle. Set to 0 to keep all rows (default)
-maxlogtimeout = The maximum age (in minutes) of a log line while being kept internally by Kettle. Set to 0 to keep all rows indefinitely (default)
[root@localhost data-integration]#
kettle图形界面工具spoon,在gui下的终端窗口内运行下面的命令(gui要么本地登录,要么远成用rdp客户端登录,比如windows远程桌面程序来登录):
cd /opt/kettle/data-integration
[root@localhost data-integration]# nohup ./spoon.sh &
[1] 11243
nohup: 忽略输入并把输出追加到"nohup.out"
[root@localhost data-integration]#
到此配置centos7 kettle7 可以远程登录服务器执行kettle spoon完成。