`
lymalf
  • 浏览: 3265 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

ServiceMix中使用SSH远程登录

 
阅读更多

Using remote instances

Configuring remote instances

It does not always make sense to manage an instance of Karaf using its local console. You can manage Karaf remotely using a remote console.

When you start Karaf, it enables a remote console that can be accessed over SSH from any other Karaf console or plain SSH client. The remote console provides all the features of the local console and gives a remote user complete control over the container and services running inside of it.

The SSH hostname and port number is configured in the [karaf_install_dir]/etc/org.apache.karaf.shell.cfg configuration file with the following default values:

sshPort=8101
sshHost=0.0.0.0
sshRealm=karaf
hostKey=${karaf.base}/etc/host.key

You can change this configuration using the config commands or by editing the above file, but you'll need to restart the ssh console in order for it to use the new parameters.

# define helper functions
bundle-by-sn = { bm = new java.util.HashMap ;  each (bundles) { $bm put ($it symbolicName) $it } ; $bm get $1 }
bundle-id-by-sn = { b = (bundle-by-sn $1) ; if { $b } { $b bundleId } { -1 } }
# edit config
config:edit org.apache.karaf.shell
config:propset sshPort 8102
config:update 
# force a restart
osgi:restart --force (bundle-id-by-sn org.apache.karaf.shell.ssh)

Connecting and disconnecting remotely

Using the ssh:ssh command

You can connect to a remote Karaf's console using the ssh:ssh command.

karaf@root> ssh:ssh -l karaf -P karaf -p 8101 hostname

The default password is karaf but we recommend changing it. See the security section for more informations.

To confirm that you have connected to the correct Karaf instance, type shell:info at the karaf> prompt. Information about the currently connected instance is returned, as shown.

Karaf
  Karaf home                  /local/apache-karaf-2.0.0
  Karaf base                  /local/apache-karaf-2.0.0
  OSGi Framework              org.eclipse.osgi - 3.5.1.R35x_v20090827
JVM
  Java Virtual Machine        Java HotSpot(TM) Server VM version 14.1-b02
  ...

Using the Karaf client

The Karaf client allows you to securely connect to a remote Karaf instance without having to launch a Karaf instance locally.

For example, to quickly connect to a Karaf instance running in server mode on the same machine, run the following command from the karaf-install-dir directory:

bin/client

More commonly, you would provide a hostname, port, username and password to connect to a remote instance. And, if you were using the client within a larger script, you could append console commands as follows:

bin/client -a 8101 -h hostname -u karaf -p karaf features:install wrapper

To display the available options for the client, type:

> bin/client --help
Apache Karaf client
  -a [port]     specify the port to connect to
  -h [host]     specify the host to connect to
  -u [user]     specify the user name
  -p [password] specify the password
  --help        shows this help message
  -v            raise verbosity
  -r [attempts] retry connection establishment (up to attempts times)
  -d [delay]    intra-retry delay (defaults to 2 seconds)
  [commands]    commands to run
If no commands are specified, the client will be put in an interactive mode

Using a plain SSH client

You can also connect using a plain SSH client from your *nix system or Windows SSH client like Putty.

~$ ssh -p 8101 karaf@localhost
karaf@localhost's password: 

Disconnecting from a remote console

To disconnect from a remote console, press Ctrl+D, shell:logout or simply logout at the Karaf prompt.

Stopping a remote instance

Using the remote console

If you have connected to a remote console using the ssh:ssh command or the Karaf client, you can stop the remote instance using the osgi:shutdown command.

Pressing Ctrl+D in a remote console simply closes the remote connection and returns you to the local shell.

Using the Karaf client

To stop a remote instance using the Karaf client, run the following from the karaf-install-dir/lib directory:

bin/client -u karaf -p karaf -a 8101 hostname osgi:shutdown

===================================================================================

 

 

1.通过ServiceMix登录Linux

在ServiceMix中输入命令ssh 远程机器的IP地址,例如ssh 192.168.0.3

然后在Login:后输入用户名,在Password:后输入密码

登录后如下图



                            通过servicemix登录linux

 

2.

 

  • 大小: 7.9 KB
分享到:
评论

相关推荐

    servicemix 7安装使用及camel-cxf代理webservice

    在实际使用中,需要编写Camel的XML或者Java DSL配置,定义路由规则,然后部署到ServiceMix中。此外,对于CXF的配置,可能涉及到服务端点(Endpoint)、服务接口和服务实现的定义,以及WSDL的生成和发布。 总的来说...

    servicemix

    为了在Eclipse中使用Ant,需要确保项目使用的JRE是JDK,并且在Eclipse的偏好设置面板中进行检查和配置。此外,Ant的构建文件采用XML格式,可以在Eclipse的Ant视图中运行特定的目标任务。 总结:Apache ServiceMix...

    使用servicemix实现FTP连接池

    标题“使用servicemix实现FTP连接池”指的是在Java环境中利用Apache ServiceMix框架来创建一个FTP连接池,以提高FTP客户端的性能和资源管理效率。ServiceMix是Apache软件基金会的一个开源企业服务总线(ESB),它...

    servicemix代理web service

    【Servicemix代理Web Service】是企业级集成平台Apache Servicemix中的一个重要功能,它允许开发者通过Servicemix来代理和管理外部的Web服务。这种代理方式提供了多种优势,包括服务的路由、转换、监控以及安全性...

    快速入门指南 中文版 ServiceMix4

    Apache ServiceMix快速入门指南旨在帮助用户在20分钟内熟悉并开始...通过安装、启动、控制台操作以及基本的bundle管理和路由配置,用户可以迅速掌握ServiceMix的核心功能,进一步探索其在企业级集成项目中的强大潜力。

    蓝眼睛ServiceMix教程

    根据给定的信息,“蓝眼睛ServiceMix教程”主要围绕ServiceMix这一技术进行介绍,涉及其安装配置、基础概念以及如何在企业环境中应用等方面。下面将基于这些内容,详细展开相关知识点。 ### ServiceMix简介 ...

    Maven管理ServiceMix工程

    在Java企业级开发中,Apache ServiceMix是一个流行的开源企业服务总线(ESB)和应用服务器,它基于OSGi容器,并且集成了许多开源项目,如Apache Camel、CXF等。Maven作为Java项目的构建工具,通过其强大的依赖管理和...

    ServiceMix学习笔记

    本篇学习笔记将深入探讨ServiceMix的使用,包括其安装、核心概念以及如何创建Maven项目。 1. **ServiceMix 安装与入门** ServiceMix 的安装非常简单,只需从Apache官网下载对应的压缩包,解压后进入bin目录,运行...

    serviceMix大合集

    3. **Java管理扩展(JMX)**:JMX用于管理和监控Java应用程序,ServiceMix通过JMX提供了管理接口,允许用户远程监控和控制ServiceMix实例。 4. **JAX-RS**:这是Java中的RESTful Web服务规范,ServiceMix支持JAX-RS...

    ServiceMix插件

    2. **实时监控**:查看ServiceMix中的服务状态,包括服务运行情况、资源使用情况、错误日志等。 3. **图形化配置**:利用可视化工具创建和编辑服务配置,降低学习曲线,提高开发效率。 4. **调试服务**:提供调试...

    serviceMix小例子

    这个"serviceMix小例子"提供了一个实践Camel组件和ServiceMix功能的起点,有助于学习和理解如何在实际场景中使用ESB进行系统集成。通过深入研究这个例子,你可以进一步掌握ServiceMix和Camel的精髓,从而更有效地...

    使用Servicemix(ESB)发布一个外部的WebService

    ### 使用Servicemix(ESB)发布外部WebService详解 #### SOA与ESB概览 在探讨如何使用Servicemix(ESB)发布一个外部的WebService之前,有必要先理解SOA(面向服务的体系结构)和ESB(企业服务总线)的基本概念。 **...

    SERVICEMIX学习笔记最终版.pdf

    - 使用`mvn archetype:create-DarchetypeArtifactId=servicemix-service-unit-DarchetypeGroupId=org.apache.servicemix.tooling-DartifactId=tutorial-file-su`命令可以创建一个基于ServiceMix的服务单元项目模板...

    Mule V.S ServiceMix

    JBI标准定义了部署单元格式,使得BPEL引擎、规则引擎、转换引擎、脚本引擎等集成组件能够热部署到ServiceMix环境中。ServiceMix还包括对WS-*规范的支持,例如WS通知,这些都是通过JBI实现的。 ServiceMix的JBI内核...

    ServiceMix做内部服务器发布WebService(附带案例源码)

    3. **部署描述符(Deployment Descriptor)**:在ServiceMix中,通常使用XML配置文件(如cxf.xml或wsdl2java.xml)来配置Web服务的部署。这些文件包含了关于服务绑定、端点地址、数据转换等信息。 4. **Web服务生成...

    Servicemix做代理服务器发布WebService

    Servicemix做代理服务器发布WebService,Login登录实际代码。对应博客中ServiceMix做代理服务器发布WebService(附带案例源码) 该篇例子,需要的可以去看看,这个是源码。

    ServiceMix学习之我见

    ServiceMix 是一个开源的企业服务总线(Enterprise Service Bus, ESB),它基于 Java Business Integration (JBI) 标准,为分布式系统提供灵活、可扩展的集成解决方案。ESB 是现代企业架构中的关键组成部分,它允许...

    JBI开发指南(Servicemix开发指南)

    ServiceMix-bean组件则是ServiceMix中的一个JBI组件,它提供了与POJO(Plain Old Java Object)的集成方式,使得开发者可以轻松地使用POJO处理JBI消息交换。 ServiceMix-bean组件的核心概念包括: 1. JBI是什么? ...

Global site tag (gtag.js) - Google Analytics