部署和安装应用程序以及数据库(MySQL或MariaDB)-离线环境- [英] Deploy and install application along with database (MySQL or MariaDB) --offline environment--

查看:97
本文介绍了部署和安装应用程序以及数据库(MySQL或MariaDB)-离线环境-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Java应用程序使用MariaDB(MySQL)数据库.目前的困难是使用一个简单的程序包进行部署,以便可以轻松地将它们安装在另一台服务器上(该服务器很可能已与外界断开连接,因此没有下载脚本可以正常工作).无论如何,这可以做到吗?也许是脚本编写还是打包?有没有人有执行此任务的经验?我确信这是Intranet服务器应用程序的常见情况.他们通常如何做?

My Java application uses MariaDB (MySQL) Database. The difficulty at the moment is deployment using a simple package so that these can be installed on another server with ease (The server is most likely disconnected from the outer world so no downloading scripts will work). Is there anyway this can be done? Perhaps, scripting or packaging? Does anyone have experience in doing such task? I am certain that this is a common situation for intranet server applications. How are they usually done?

我已经完成了研究,并且我知道可以嵌入诸如Derby之类的替代数据库.当然,这是一个选择,但如果可能的话,我想坚持使用MySQL.另外,这是一个开源项目,因此不需要法律建议.我正在尝试解决问题,而不是绕开它-至少目前是这样.

I have done my research, and I know there are alternative database such as Derby which can be embedded. This is surely an option, but I would like to stick with MySQL if possible. Also, it's an open-source project so no need for legal advice. I'm trying to tackle the problem not run around it --at least for now.

*假设服务器离线 *假设服务器上没有root特权 *易于设置和配置(可能没有安装过程) *自动化过程

* Assume server is Offline * Assume no root privileges on the server * Easy to set up & configure (possibly no install procedure) * Automate the process

推荐答案

因此,对于那些正在寻找实现此目的的人. 我会回答我自己的问题.

So, for someone out there who would be looking for a way to do this. I will answer my own question.

  1. 如下所示,您可以考虑利用Docker之类的平台,但这需要您在服务器上安装Docker.另外,我不太确定linux容器是否可以像物理安装在服务器上的应用程序那样执行.这可能取决于应用程序.由于它是相当新的,因此您还必须花很多时间来适应它.

  1. As suggested below, you can consider taking advantage of platforms like Docker, but it requires you to install Docker on the server. Also, I am not too sure if linux container can perform just as an application physically installed on the server would. It probably depends on the application. Since it is fairly new, you would also have to fiddle with it a lot to get used to it.

另一种解决方案是下载二进制tar并遵循不需要root用户访问权限的安装指南(这是我开始使用Linux x86_64服务器的位置:

Another solution is to download binary tar and follow install guides that does not require root access (This is where I started for Linux x86_64 server: http://www.bluecrownsoftware.com/article/271/Installing-MySQL-without-Root-Access-on-Linux). Then you can zip up the entire directory. Minor settings after migration can be done with scripts. However, this requires that you have deployments ready for all kinds of OS. Beware...I had to face countless errors due to poorly written scripts. They basically wrote the scripts assuming your environment is not local. Maybe I can help you if you are having troubles. I got it to work for this OS at least.

您可以查找便携式版本,例如( https: //code.google.com/p/pts-mini-gpl/wiki/Portable_MariaDB ),但不太可能在每个操作系统中都存在.

You can look for portable versions such as (https://code.google.com/p/pts-mini-gpl/wiki/Portable_MariaDB) but it is unlikely that these exists for every OS.

由于我现在只有几个操作系统要为我的项目担心,因此我可能会坚持使用项目2. GL大家.结案了.

I will probably stick with option 2 for my project since I have only couple of OS to worry about for my project now. GL everybody. Case closed.

这篇关于部署和安装应用程序以及数据库(MySQL或MariaDB)-离线环境-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆