elasticsearch 설치에 cloudformation을 사용하고 있습니다. tar.gz를 다운로드하고 압축을 풉니 다. 다음은 내 EC2 인스턴스 섹션 :AWSCloudFormation - cfn-init 명령을 실행하지 못했습니다.
"masterinstance": {
"Type": "AWS: : EC2: : Instance",
"Metadata": {
"AWS: : CloudFormation: : Init": {
"configSets" : {
"ascending" : [ "config1" , "config2" ]
},
"config1": {
"sources": {
"/home/ubuntu/": "https: //s3.amazonaws.com/xxxxxxxx/elasticsearch.tar.gz"
},
"files": {
"/home/ubuntu/elasticsearch/config/elasticsearch.yml": {
"content": {
"Fn: : Join": [
"",
[
xxxxxxxx
]
]
}
}
}
},
"config2" : {
"commands": {
"runservice": {
"command": "~/elasticsearch/bin/elasticsearch",
"cwd" : "~",
"test" : "~/elasticsearch/bin/elasticsearch > test.txt",
"ignoreErrors" : "false"
}
}
}
}
},
"Properties": {
"ImageId": "ami-xxxxxxxxxx",
"InstanceType": {
"Ref": "InstanceTypeParameter"
},
"Tags": [
xxxxxxxx
],
"KeyName": "everybody",
"NetworkInterfaces": [
{
"GroupSet": [
{
"Ref": "newSecurity"
}
],
"AssociatePublicIpAddress": "true",
"DeviceIndex": "0",
"SubnetId": {
"Ref": "oneSubnet"
}
}
],
"UserData": {
"Fn: : Base64": {
"Fn: : Join": [
"",
[
"#!/bin/bash\n",
"sudo add-apt-repository-yppa: webupd8team/java\n",
"sudo apt-get update\n",
"echo'oracle-java8-installershared/accepted-oracle-license-v1-1selecttrue'|sudo debconf-set-selections\n",
"sudo apt-getinstall-yoracle-java8-installer\n",
"apt-get update\n",
"apt-get-y installpython-setuptools\n",
"easy_installhttps: //s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz\n",
"/usr/local/bin/cfn-init",
"--stack Elasticsearch",
"--resource masterinstance",
"--configsets ascending",
"-v\n"
]
]
}
}
} } 내가 구성 및 기타 설정에 대한 AWS::CloudFormation::Init
사용하고
. 타르를 추출한 후 elasticsearch를 시작하고 싶습니다. 섹션을 AWS::CloudFormation::Init
에 넣었습니다. 그러나 은 내 인스턴스에 ssh를 넣었을 때 스택 생성을 완료 한 후 실행되었습니다. 내 elasticsearch 서비스가 실행되지 않습니다. tar 추출 및 파일 작성과 같은 다른 모든 작업이 올바르게 작동합니다.
2016-07-19 05:53:15,776 P2745 [INFO] Test for Command runservice
2016-07-19 05:53:15,778 P2745 [INFO] -----------------------Command Output-----------------------
2016-07-19 05:53:15,778 P2745 [INFO] /bin/sh: 1: ~/elasticsearch/bin/elasticsearch: not found
2016-07-19 05:53:15,778 P2745 [INFO] ------------------------------------------------------------
2016-07-19 05:53:15,779 P2745 [ERROR] Exited with error code 127
~
그때가 완벽하게 작동하고 내 인스턴스에서 직접 위의 명령 ~/elasticsearch/bin/elasticsearch
을 해고하는 경우 : 나는 CFN-init.log 겪었
, 그것은 나에게 다음과 같은 정보를 제공합니다.
내가 여기서 잘못하고있는 것.
감사합니다.
로그에 정보가 있습니까? – Daniel777
아래 답변이 귀하의 질문을 해결 한 경우 [수락 됨으로 표시] (http://meta.stackexchange.com/a/5235/327137)를 잊지 마십시오. – wjordan