SOLR Cloud(4)Elasticbeanstalk Zookeeper

本文介绍如何使用Elasticbeanstalk部署SolrCloud及Zookeeper集群,详细配置包括Docker镜像设置、Makefile文件定义及弹性Beanstalk环境变量等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SOLR Cloud(4)Elasticbeanstalk Zookeeper

Elasticbeanstalk will use this find to find the Docker Image and some simple Settings
Dockerrun.aws.json
{
"AWSEBDockerrunVersion": 2,
"volumes": [{
"name": "zoo-data",
"host": {
"sourcePath": "/media/ephemeral0/zoo-data"
}
},
{
"name": "zoo-data-log",
"host": {
"sourcePath": "/media/ephemeral0/zoo-data-log"
}
}
],
"containerDefinitions": [{
"name": "zookeeper",
"image": “xxxxxx.dkr.ecr.us-east-1.amazonaws.com/odt/zookeeper",
"essential": true,
"memory": 3000,
"mountPoints": [{
"sourceVolume": "zoo-data",
"containerPath": "/data"
},
{
"sourceVolume": "zoo-data-log",
"containerPath": "/datalog"
}
],
"portMappings": [{
"hostPort": 2181,
"containerPort": 2181
},
{
"hostPort": 2888,
"containerPort": 2888
},
{
"hostPort": 3888,
"containerPort": 3888
}
]
}]
}

Makefile to start the zookeeper1 ~ 3 Servers
zookeeper1:
eb create -c zookeeper1 --tag owner=carl \
--envvars "ZOO_MY_ID=1,ZOO_SERVERS=server.1=0.0.0.0:2888:3888 server.2=zookeeper2.us-east-1.elasticbeanstalk.com:2888:3888 server.3=zookeeper3.us-east-1.elasticbeanstalk.com:2888:3888" \
zookeeper1

zookeeper2:
eb create -c zookeeper2 --tag owner=carl \
--envvars "ZOO_MY_ID=2,ZOO_SERVERS=server.1=zookeeper1.us-east-1.elasticbeanstalk.com:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zookeeper3.us-east-1.elasticbeanstalk.com:2888:3888" \
zookeeper2

zookeeper3:
eb create -c zookeeper3 --tag owner=carl \
--envvars "ZOO_MY_ID=3,ZOO_SERVERS=server.1=zookeeper1.us-east-1.elasticbeanstalk.com:2888:3888 server.2=zookeeper2.us-east-1.elasticbeanstalk.com:2888:3888 server.3=0.0.0.0:2888:3888" \
zookeeper3

Pay attention to the 0.0.0.0, that is the local server, because of the bind action, we have to use 0.0.0.0

Some hidden Configuration in .ebextensions
ec2-instances.config
ephemeral.config
healthcheck.config
load-balancer.config
logging.config
other.config

ec2-instances.config
option_settings:
aws:elasticbeanstalk:environment:
ServiceRole: aws-elasticbeanstalk-service-role
aws:ec2:vpc:
VPCId: vpc-xxxxxx
Subnets: subnet-xxxxxxx
aws:autoscaling:launchconfiguration:
SecurityGroups: sg-xxxxxx
IamInstanceProfile: aws-elasticbeanstalk-ec2-role
InstanceType: m3.medium
EC2KeyName: engineers-20161108

ephemeral.config
option_settings:
aws:autoscaling:launchconfiguration:
BlockDeviceMappings: /dev/sdb=ephemeral0

healthcheck.config
option_settings:
aws:elasticbeanstalk:application:
Application Healthcheck URL: TCP:2181
aws:elb:healthcheck:
HealthyThreshold: 2
Interval: 300
UnhealthyThreshold: 2

load-balancer.config
option_settings:
aws:elasticbeanstalk:environment:
LoadBalancerType: classic
aws:elb:listener:2181:
ListenerProtocol: TCP
InstancePort: 2181
InstanceProtocol: TCP
aws:elb:listener:2888:
ListenerProtocol: TCP
InstancePort: 2888
InstanceProtocol: TCP
aws:elb:listener:3888:
ListenerProtocol: TCP
InstancePort: 3888
InstanceProtocol: TCP
aws:ec2:vpc:
ELBSubnets: subnet-c94909be,subnet-97dca3bc
ELBScheme: internal

logging.config
option_settings:
aws:elasticbeanstalk:hostmanager:
LogPublicationControl: true
aws:elasticbeanstalk:cloudwatch:logs:
DeleteOnTerminate: true
StreamLogs: true

other.config
option_settings:
aws:elasticbeanstalk:sns:topics:
Notification Endpoint: cluo@jobs2careers.com
aws:autoscaling:asg:
MaxSize: '1'

The setting will be 3 elastic beanstalk, each will have only 1 server with 1 load balance.
ELB URLs are configured in the settings of zookeeper cluster.

Some useful command is as follow:

>eb init

>eb list

>eb terminate

>eb create

References:
http://sillycat.iteye.com/blog/2397642
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值