linux迁移服务,linux转移文件

本篇文章给大家谈谈linux迁移服务,以及linux转移文件对应的知识点,文章可能有点长,但是希望大家可以阅读完,增长自己的知识,最重要的是希望对各位有所帮助,可以解决了您的问题,不要忘了收藏本站喔。

Linux系统怎么把其他分区的空间转移给/home分区

参考步骤:

1、在虚拟机中添加一块SCSI磁盘

2、建立一个20G分区,用于普通用户的宿主文件夹

3、将新分区挂载到/home目录下

4、服务器每次开机自动挂载

详细如下:

1、关机后添加新磁盘,重新开机进入RHEL5系统。

2、分区格式化

1)使用fdisk命令对新硬盘进行分区,建立一个20gb的主分区(/dev/sdb1)。

2)执行partprobe更新分区表信息,使用mkfs命令将该分区格式化为ext3文件系统。

3、迁移/home目录

1)转移原有/home目录中的内容并做好备份

因为home里面没有数据所以会出现这样的错误这边我就自己建立一点文件到里面就可以了

2)修改/etc/fstab文件中的分区挂载设置。

命令:vi/etc/fstab0不用启动

设备名挂载点文件系统类型挂载参数(rwro只读noexec禁用程序)需否备份顺序

添加后保存退出:/dev/sdb1/homeext3defaults00

3)按/etc/fstab文件中设置将新建的分区挂载到/home目录下

命令: mount/dev/sdb1

4)将“1)“中的备份的用户数据复制到新挂载/home文件系统。

命令:mv/home_backup/*/home/

命令:rm-rf/home_backup/

这边最后一个命令删除备份文件就可以了整个/home数据备份迁移就完成了!

如何利用mono把.net windows service程序迁移到linux上

目的:使用mono将ASP.NET编写的Window服务移植到Linux下运行

使用的软件:mono2.0, Linux Red hat

步骤:

1、在Window下编写一个Remoting服务端作为Window服务。包括

RemoteServer.exe(服务运行文件)

RemoteServer.exe.config(配置文件)

将这两个文件放到Linux系统的一个目录下,本例放在/home/RemoteTest/RemoteServer下

2、编写Linux服务脚本sjhServer,将脚本放在/etc/rc.d/init.d目录下

3、建立符号链接。建立相应运行级别的脚本符号链接,本例中是2、3、4、5级,使用命令:

cd/etc/rc.d/rc2.d(相应地建立第3级的链接,cd到rc3.d目录下)

ln–s/etc/rc.d/init.d/sjhServer S97sjhServer

4、启动服务。使用命令:

service sjhService start

5、本例中有一个客户端程序RemoteClient.exe用做侦听。运行RemoteClient.exe,返回运行结果说明服务已经在运行,如果客户端出现目标机器积极拒绝说明服务没有启动

6、停止服务,使用命令:

service sjhService stop

到此ASP.NET的服务移植到Linux就算完成,和其它Linux的系统服务一样,操作方法都一样。

存在的几个疑点:

一、第3点建立符号链接时,只建立了S的链接,没有建立K的链接。还有启动和停止服务的顺序的定义有什么规则,是否对其它服务有顺序上的依赖。

二、服务的暂停不起作用,Remoting这个服务是否没有这个概念。其它类型服务有待测试。

另外一种方式:

如何在Linux部署mono,并成功的运行.net程序,还请大家多多查询吧,我在这方面也只是搭建成功了,遇到的问题不足够多,就不误导大家了。

用mono来在Linux运行一个.net程序还是很容易的,但如何运行一个后台服务程序呢,今天也是费了九牛二虎之力,最后借鉴一下stackoverflow中的一个回答来诠释这个难题吧。

Under Linux, deamons are simple background processes. No special control methods(e.g start(), stop()) are used as in Windows. Build your service as a simple(console) application, and run it in the background. Use a tool like daemonizeto run a program as a Unix daemon, and remember to specify mono as the program to be activated.

As noted by others, mono-service is a host to run services built with the ServiceProcess assembly. Services built for Windows can use this method to run unmodified under Linux. You can control the service by sending signals to the process(see man page).

我英文不是太好,只能大概理解其中的意思。里边的滋味大家可以自己细细品味。

大致意思就是说,第一种方式:在Linux下可以把windows服务改造成一个控制台程序来运行。第二种方式:用mono-service来运行windows的服务程序。前提是你这个程序是有.net写成的。

mono-service运行时参数又该如何配置呢?

命令格式:mono-service [options] program.exe

-d:DIRECTORYUse this option to specify the working directory for the service. The default is the current directory.

-l:LOCKFILESpecifies the file to use for locking, the default is a filename constructed in/tmp based on the name of the program that hosts the service.

-m:MESSAGEName to show in the syslog.

-n:NAMEUse this to specify the service to be launched(if the program contains more than one service). The default is to run the first defined service.

--debug:Use this option to prevent mono-service from redirecting stdin and stdout and prevent the program to be sent to the background. Equivalent to

--no-daemon:Use this option to prevent mono-service from redirecting stdin and stdout and prevent the program to be sent to the background. Equivalent to--debug.

例:mono-service-l:/root/service-lock MyService.exe

控制服务(这几种操作的区别请参考windows的使用方式,这里我就不做过多解释了):

暂停: kill-USR1'cat<lock file>'

继续: kill-USR2'cat<lock file>'

停止: kill'cat<lock file>'

注意:Use mono-service to run services that use the 1.0 assemblies and use mono-service2 to run services that use the 2.0 assemblies.

mono-service可以运行.net 1.0的程序集,mono-service2可以运行.net 2.0的程序集。

如何将一台linux系统的物理服务器迁移到esx server上

对于linux迁移,目前只能通过converter standalone 4.0实现。即VC自带的4.0 converter插件无法实现迁移。你需要找一台Windows的机器,然后安装converter 4.0,通过这台机器进行linux的迁移。过程中需要输入一个代理服务器的ip及相关信息,记住这点很重要,这个ip不能是你安装converter的Windows也不能是你被迁移的linux。只要是这之外的任意一台Windows服务器即可,必须在线。

阅读剩余
THE END