Skip to content

Commit

Permalink
Update opensearch.yml config for remote-store (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Singh <sngri@amazon.com>
  • Loading branch information
rishabh6788 committed Sep 7, 2023
1 parent 2d3e07b commit de2874c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/infra/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class InfraStack extends Stack {
if (props.dataEc2InstanceType) {
singleNodeInstanceType = props.dataEc2InstanceType;
} else if (props.cpuType === AmazonLinuxCpuType.X86_64) {
singleNodeInstanceType = InstanceType.of(InstanceClass.R5, InstanceSize.XLARGE) ;
singleNodeInstanceType = InstanceType.of(InstanceClass.R5, InstanceSize.XLARGE);
} else {
singleNodeInstanceType = InstanceType.of(InstanceClass.R6G, InstanceSize.XLARGE);
}
Expand Down Expand Up @@ -500,13 +500,25 @@ export class InfraStack extends Stack {
}

// eslint-disable-next-line max-len
cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch; echo "cluster.remote_store.segment.repository: ${scope.stackName}-repo" >> config/opensearch.yml`, {
cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch; echo "node.attr.remote_store.segment.repository: ${scope.stackName}-repo" >> config/opensearch.yml`, {
cwd: '/home/ec2-user',
ignoreErrors: false,
}));

// eslint-disable-next-line max-len
cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch; echo "cluster.remote_store.translog.repository: ${scope.stackName}-repo" >> config/opensearch.yml`, {
cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch; echo "node.attr.remote_store.repository.${scope.stackName}-repo.type: s3" >> config/opensearch.yml`, {
cwd: '/home/ec2-user',
ignoreErrors: false,
}));

// eslint-disable-next-line max-len
cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch; echo "node.attr.remote_store.repository.${scope.stackName}-repo.settings:\n bucket : ${scope.stackName}\n base_path: remote-store" >> config/opensearch.yml`, {
cwd: '/home/ec2-user',
ignoreErrors: false,
}));

// eslint-disable-next-line max-len
cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch; echo "node.attr.remote_store.translog.repository: ${scope.stackName}-repo" >> config/opensearch.yml`, {
cwd: '/home/ec2-user',
ignoreErrors: false,
}));
Expand Down

0 comments on commit de2874c

Please sign in to comment.