首页 > 数据库 >Windows11[虚拟机] Kettle 通过SSH隧道 连接远程[Mac] Mysql数据库

Windows11[虚拟机] Kettle 通过SSH隧道 连接远程[Mac] Mysql数据库

时间:2024-06-18 11:20:54浏览次数:12  
标签:no 端口 虚拟机 Kettle Windows11 ssh 0.0 3306 yes

Kettle无法直接连接使用SSH通道的MySQL,需要通过SSH隧道(推荐),具体操作如下所示:

一、搭建Xshell SSH 隧道转发

1、点击“连接”

借助Xshell7,首先创建会话mac(名字随便写),右键-->属性,在弹出窗口中填写名称(随便写),填写主机:SSH隧道的ip地

 点击“添加”按钮出现如下,填写源主机:localhost(一般填写localhost), 侦听端口:XXX(端口随便写,但是一定要记住,用于kettle连接数据库) , 目标主机:数据库IP地址(远程主机的IP地址) , 目标端口:3306(mysql开放的端口)

 

点击连接,连接到远程服务器,在Xshell下方的"隧道窗格"中,将看到我们配置的转发规则,如下

 注意看规则的第一行转发配置,确保状态是打开,如果显示的是失败可能是3306这个本地端口已经被占用了,可以尝试将侦听端口修改为其它端口进行重新设置。

二、检查远程服务器MySql文件配置

1、netstat -anp tcp | grep 3306                        

注意地方,这说明3306被绑定到了本地。检查一下my.cnf的配置,这里可以配置绑定ip地址。

cd /usr/local/etc

找到my.cnf文件,修改如下:bind-address=0.0.0.0

不配置或者IP配置为0.0.0.0,表示监听所有客户端连接。

三、开启SSH远程转发功能

SSH默认不允许远程转发

#	$OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

# This Include directive is not part of the default sshd_config shipped with
# OpenSSH. Options set in the included configuration files generally override
# those that follow.  The defaults only apply to options that have not been
# explicitly set.  Options that appear multiple times keep the first value set,
# unless they are a multivalue option such as HostKey.
Include /etc/ssh/sshd_config.d/*

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile	.ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
#Subsystem	sftp	/usr/libexec/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server

# XAuthLocation added by XQuartz (https://www.xquartz.org)
XAuthLocation /opt/X11/bin/xauth

 

四、在本地测试远程连接

  打开终端

  1、ping 远程ip,如果可以ping通,代表主机可以正常连接。

  2、telnet ip地址 端口号

 以上代表成功。

telnet 主机3306端口不可以;
telnet 主机22端口可以;
说明与本机网络没有关系; 

 

端口检测
1)netstat -ntpl |grep 3306
tcp 0 0 :::3306 :::* LISTEN -
2)netstat -ntpl |grep 22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
可以看出22端口监听所有地址,而3306只监听本机地址(绑定了到了本地),所以远程无法访问。
对于端口只允许本机访问,有两个地方启用,一个是防火墙启用3306,一个就是mysql配置绑定本机地址。

五、kettle使用SSH隧道建立数据库连接

 

 

 

标签:no,端口,虚拟机,Kettle,Windows11,ssh,0.0,3306,yes
From: https://www.cnblogs.com/jerryspace/p/18253981

相关文章

  • Windows11系统Win32_EncryptableVolume.dll文件丢失问题
    其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库,这时你可以下载这个Win32_EncryptableVolume.dll文件(挑选合适......
  • Windows11系统webview2_integration.dll文件丢失问题
    其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库,这时你可以下载这个webview2_integration.dll文件(挑选合适的版......
  • Windows11系统webengine4.dll文件丢失问题
    其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库,这时你可以下载这个webengine4.dll文件(挑选合适的版本文件)把......
  • Windows11系统webview2standalone.dll文件丢失问题
    其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库,这时你可以下载这个webview2standalone.dll文件(挑选合适的版本......
  • Kettle 数据抽取工具使用教程:从入门到实战
    一、简介Kettle是PentahoDataIntegration(PDI)的一个组成部分,是一个开源的数据集成工具。它被广泛用于数据的抽取、转换和加载(ETL)过程。Kettle提供了一个易于使用的图形界面,可以轻松设计和执行ETL流程。github源码地址:https://github.com/pentaho/pentaho-......
  • 如何在WIndows虚拟机安装 macOS 黑苹果系统?
    在本教程中,我们将介绍如何在虚拟机上安装macOS黑苹果系统。黑苹果系统是非苹果公司官方支持的macOS系统的非官方版本,可以在普通PC上运行。请注意,安装黑苹果系统可能违反苹果的许可协议,请自行承担风险。参考视频教程:https://www.youtube.com/watch?v=FO9Bwa5btn81......
  • Windows中搭建centos虚拟机和MySQL
    背景前一段时间,博主为了在家里搭建学习环境,想模拟一个生产环境,尝试了Windows安装WSL、Vmwareworkstationplayer安装Ubuntu、把Window删了直接装Ubuntu、把Ubuntu删了装回Windows(Windows一直无法安装到SSD,最后拆了电脑拔了机械硬盘才装成功)的多个阶段,发现还是Windows用的习惯......
  • kettle从入门到精通 第七十课 ETL之kettle kettle数据校验,脏数据清洗轻松拿捏
    场景:输入在指定的错误(错误应涵盖数据类型不匹配的情况)行数内,trans不报错,但通过错误处理步骤捕捉,并记入文件,整个数据管线正常完成直至处理完最后一个输入行。解决方案:使用步骤【数据检验】进行处理。这个步骤和常规的业务系统对接三方接口一个逻辑,将符合规则的数据放行,不符合的......
  • 记录:利用共享wifi+桥接的方式实现远程访问另一台电脑上的vm虚拟机上的服务
    情景描述:1、电脑1:操作端,试图访问电脑2上的虚拟机。电脑1通过有线访问网络,同时可以依靠无线网卡开启共享wifi。2、电脑2:被控端,上面的vm17虚拟机centos7中部署有nginx和docker上的微服务;电脑2的防火墙关闭,或者防火墙有对应微服务的端口出入站规则。本文原文:https://www.cnblogs.c......
  • android studio 启动虚拟机长时间无响应,无法启动(二)
    书接上回,MAC更新到11.0需要40GB,但是我的电脑一共120GB,系统内存占了70GB,更新完MAC是剩不下空间了,因此不选择更新版本,重新安装了较低版本的AndroidstudioAndroidstudio官网又出现了新的问题。。。问题PANIC:BrokenAVDsystempath.CheckyourANDROID_SDK_ROOTvalu......