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
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