如何使用自己的许可证密钥在AWS EC2上运行MarkLogic?

如何使用自己的许可证密钥在AWS EC2上运行MarkLogic?,marklogic,Marklogic,我启动了一个运行linux的EC2实例,并安装了MarkLogic服务器rpm。但当我尝试启动MarkLogic服务时,会看到如下消息: Waiting for block device on /dev/sdf Waiting for block device on /dev/sdf Waiting for block device on /dev/sdf 没有/dev/sdf。如何克服这个问题?MarkLogic Server for linux内置了一个假设。如果它看到它在xen虚拟机监控

我启动了一个运行linux的EC2实例,并安装了MarkLogic服务器rpm。但当我尝试启动MarkLogic服务时,会看到如下消息:

Waiting for block device on /dev/sdf
Waiting for block device on /dev/sdf
Waiting for block device on /dev/sdf

没有
/dev/sdf
。如何克服这个问题?

MarkLogic Server for linux内置了一个假设。如果它看到它在xen虚拟机监控程序下运行,并且可以使用AWS API找到EC2主机名,那么它将假定它是MarkLogic Server AMI的一个实例。该AMI希望使用
/dev/sdf
作为其默认数据目录。本文档主要讨论如何使用MarkLogic Server AMI,但在下面的部分中简要介绍了此问题的解决方案

事实证明,启动脚本
/etc/init.d/MarkLogic
正在查看环境变量
MarkLogic\u EBS
,以决定是否等待
/dev/sdf
出现。该
MARKLOGIC\u EBS
变量在
/etc/sysconfig/MARKLOGIC
中设置,管理员可以编辑该变量(例如,您也可以在此处将
MARKLOGIC\u USER
设置为
守护进程
以外的内容)

因此,我们可以编辑
/etc/sysconfig/MarkLogic
以忽略
/dev/sdf
。以下是该文件中有趣的部分:

# the initial hostname that MarkLogic should use on Amazon EC2
if [ -d /proc/xen ]; then
  if [ "`curl -s --connect-timeout 2 -o /tmp/public-hostname -w %{http_code} http://169.254.169.254/2007-03-01/meta-data/public-hostname`" = "200" ]; then
    MARKLOGIC_HOSTNAME=`cat /tmp/public-hostname`
    MARKLOGIC_EC2_HOST=1
    MARKLOGIC_EBS=/dev/sdf
  fi
fi
最简单的解决方案是注释掉设置
MARKLOGIC\u EBS
的行

 the initial hostname that MarkLogic should use on Amazon EC2
if [ -d /proc/xen ]; then
  if [ "`curl -s --connect-timeout 2 -o /tmp/public-hostname -w %{http_code} http://169.254.169.254/2007-03-01/meta-data/public-hostname`" = "200" ]; then
    MARKLOGIC_HOSTNAME=`cat /tmp/public-hostname`
    MARKLOGIC_EC2_HOST=1
    #MARKLOGIC_EBS=/dev/sdf
  fi
fi
这将解决问题,但MarkLogic仍将在每次服务启动或重新启动时从AWS API获取其公共主机名。这可能会造成轻微的延迟——可能不重要。但你也可以把它删掉:

# the initial hostname that MarkLogic should use on Amazon EC2
if [ "" -a -d /proc/Xxen ]; then
  if [ "`curl -s --connect-timeout 2 -o /tmp/public-hostname -w %{http_code} http://169.254.169.254/2007-03-01/meta-data/public-hostname`" = "200" ]; then
    MARKLOGIC_HOSTNAME=`cat /tmp/public-hostname`
    MARKLOGIC_EC2_HOST=1
    #MARKLOGIC_EBS=/dev/sdf
  fi
fi
不管您决定绕过EC2测试,现在都可以启动MarkLogic服务,而不必担心
/dev/sdf
。当然,您仍然需要MarkLogic服务器许可证。请参阅以了解有关不同许可证选项的更多信息


请注意,升级MarkLogic Server时,rpm可能包含新版本的
/etc/sysconfig/MarkLogic
。准备将对此文件所做的任何更改与新版本合并。

设置EC2实例时,建议您也添加EBS块。您将被要求输入设备名称。目前,在使用RedHat AMI时,无论您选择的名称如何,您的第一台设备都将作为
/dev/xvdl
安装。解决问题的方法是,完成此操作后,执行
ln/dev/xvdl/dev/sdf
——一个硬链接

如上所述,启动脚本在启动时查找此设备,如果未格式化,则对其进行格式化,并装载在
/var/opt/MarkLogic

这应该能解决问题