Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit a8bd37d

Browse files
authored
Merge pull request #2 from jdeathe/centos-7-develop
Release changes for 2.0.0
2 parents ee0a109 + b16d871 commit a8bd37d

File tree

12 files changed

+101
-25
lines changed

12 files changed

+101
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Summary of release changes for Version 2.
66

77
CentOS-7 7.5.1804 x86_64 - Redis 4.0.
88

9-
### 2.0.0 - Unreleased
9+
### 2.0.0 - 2018-11-03
1010

1111
- Initial release.

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN ln -sf \
4040
&& chgrp redis \
4141
/usr/sbin/redis-server-wrapper \
4242
&& sed -i -r \
43+
-e "s~^(logfile ).+$~\1\"\"~" \
4344
-e "s~^(bind ).+$~\10.0.0.0~" \
4445
-e "s~^(# *)?(maxmemory ).+$~\2{{REDIS_MAXMEMORY}}~" \
4546
-e "s~^(# *)?(maxmemory-policy ).+$~\2{{REDIS_MAXMEMORY_POLICY}}~" \
@@ -59,8 +60,8 @@ ENV REDIS_AUTOSTART_REDIS_BOOTSTRAP="true" \
5960
REDIS_MAXMEMORY_SAMPLES="5" \
6061
REDIS_OPTIONS="" \
6162
REDIS_TCP_BACKLOG="1024" \
62-
SSH_AUTOSTART_SSHD=false \
63-
SSH_AUTOSTART_SSHD_BOOTSTRAP=false
63+
SSH_AUTOSTART_SSHD="false" \
64+
SSH_AUTOSTART_SSHD_BOOTSTRAP="false"
6465

6566
# -----------------------------------------------------------------------------
6667
# Set image metadata

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ $ docker run \
6666
--detach \
6767
--name redis.pool-1.1.1 \
6868
--publish 6379:6379/tcp \
69+
--sysctl "net.core.somaxconn=2048" \
70+
--sysctl "net.ipv4.ip_local_port_range=1024 65535" \
71+
--sysctl "net.ipv4.route.flush=1" \
6972
--env "REDIS_MAXMEMORY=32mb" \
7073
--env "REDIS_MAXMEMORY_POLICY=allkeys-lru" \
7174
--env "REDIS_MAXMEMORY_SAMPLES=10" \
7275
--env "REDIS_OPTIONS=--loglevel verbose" \
7376
--env "REDIS_TCP_BACKLOG=2048" \
74-
--sysctl "net.core.somaxconn=2048" \
75-
--sysctl "net.ipv4.ip_local_port_range=1024 65535" \
76-
--sysctl "net.ipv4.route.flush=1" \
7777
jdeathe/centos-ssh-redis:2.0.0
7878
```
7979

default.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
define DOCKER_CONTAINER_PARAMETERS
44
--name $(DOCKER_NAME) \
55
--restart $(DOCKER_RESTART_POLICY) \
6+
--sysctl "net.core.somaxconn=$(SYSCTL_NET_CORE_SOMAXCONN)" \
7+
--sysctl "net.ipv4.ip_local_port_range=$(SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE)" \
8+
--sysctl "net.ipv4.route.flush=$(SYSCTL_NET_IPV4_ROUTE_FLUSH)" \
69
--env "REDIS_AUTOSTART_REDIS_BOOTSTRAP=$(REDIS_AUTOSTART_REDIS_BOOTSTRAP)" \
710
--env "REDIS_AUTOSTART_REDIS_WRAPPER=$(REDIS_AUTOSTART_REDIS_WRAPPER)" \
811
--env "REDIS_MAXMEMORY=$(REDIS_MAXMEMORY)" \

environment.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ DOCKER_IMAGE_RELEASE_TAG_PATTERN := ^(1|2|centos-(6-1|7-2))\.[0-9]+\.[0-9]+$
1313
# Variables
1414
# -----------------------------------------------------------------------------
1515

16+
# Docker --sysctl settings
17+
SYSCTL_NET_CORE_SOMAXCONN ?= 1024
18+
SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE ?= 1024 65535
19+
SYSCTL_NET_IPV4_ROUTE_FLUSH ?= 1
20+
1621
# Docker image/container settings
1722
DOCKER_CONTAINER_OPTS ?=
1823
DOCKER_IMAGE_TAG ?= latest
@@ -29,7 +34,7 @@ NO_CACHE ?= false
2934
DIST_PATH ?= ./dist
3035

3136
# Number of seconds expected to complete container startup including bootstrap.
32-
STARTUP_TIME ?= 1
37+
STARTUP_TIME ?= 2
3338

3439
# ------------------------------------------------------------------------------
3540
# Application container configuration

src/etc/services-config/supervisor/supervisord.d/redis-server-wrapper.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
priority = 100
33
command = /usr/sbin/redis-server-wrapper
44
autostart = %(ENV_REDIS_AUTOSTART_REDIS_WRAPPER)s
5-
startsecs = 0
5+
startsecs = 1
66
autorestart = true
77
redirect_stderr = true
8-
stdout_logfile = /var/log/redis-server-wrapper
8+
stdout_logfile = /var/log/redis/redis.log
99
stdout_events_enabled = true
1010
user = redis

src/etc/systemd/system/centos-ssh-redis@.service

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ Environment="REDIS_AUTOSTART_REDIS_BOOTSTRAP=true"
5959
Environment="REDIS_AUTOSTART_REDIS_WRAPPER=true"
6060
Environment="REDIS_MAXMEMORY=64mb"
6161
Environment="REDIS_MAXMEMORY_POLICY=allkeys-lru"
62-
Environment="REDIS_MAXMEMORY_SAMPLES=10"
62+
Environment="REDIS_MAXMEMORY_SAMPLES=5"
6363
Environment="REDIS_OPTIONS="
6464
Environment="REDIS_TCP_BACKLOG=1024"
65+
Environment="SYSCTL_NET_CORE_SOMAXCONN=1024"
66+
Environment="SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE=1024 65535"
67+
Environment="SYSCTL_NET_IPV4_ROUTE_FLUSH=1"
6568

6669
# Initialisation: Load image from local storage if available, otherwise pull.
6770
ExecStartPre=/bin/bash -c \
@@ -91,6 +94,9 @@ ExecStartPre=-/bin/bash -c \
9194
ExecStart=/bin/bash -c \
9295
"exec /usr/bin/docker run \
9396
--name %p.%i \
97+
--sysctl \"net.core.somaxconn=${SYSCTL_NET_CORE_SOMAXCONN}\" \
98+
--sysctl \"net.ipv4.ip_local_port_range=${SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE}\" \
99+
--sysctl \"net.ipv4.route.flush=${SYSCTL_NET_IPV4_ROUTE_FLUSH}\" \
94100
--env \"REDIS_AUTOSTART_REDIS_BOOTSTRAP=${REDIS_AUTOSTART_REDIS_BOOTSTRAP}\" \
95101
--env \"REDIS_AUTOSTART_REDIS_WRAPPER=${REDIS_AUTOSTART_REDIS_WRAPPER}\" \
96102
--env \"REDIS_MAXMEMORY=${REDIS_MAXMEMORY}\" \

src/opt/scmi/default.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ fi
4040
# Common parameters of create and run targets
4141
DOCKER_CONTAINER_PARAMETERS="--name ${DOCKER_NAME} \
4242
--restart ${DOCKER_RESTART_POLICY} \
43+
--sysctl \"net.core.somaxconn=${SYSCTL_NET_CORE_SOMAXCONN}\" \
44+
--sysctl \"net.ipv4.ip_local_port_range=${SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE}\" \
45+
--sysctl \"net.ipv4.route.flush=${SYSCTL_NET_IPV4_ROUTE_FLUSH}\" \
4346
--env \"REDIS_AUTOSTART_REDIS_BOOTSTRAP=${REDIS_AUTOSTART_REDIS_BOOTSTRAP}\" \
4447
--env \"REDIS_AUTOSTART_REDIS_WRAPPER=${REDIS_AUTOSTART_REDIS_WRAPPER}\" \
4548
--env \"REDIS_MAXMEMORY=${REDIS_MAXMEMORY}\" \

src/opt/scmi/environment.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ NO_CACHE="${NO_CACHE:-false}"
2828
DIST_PATH="${DIST_PATH:-./dist}"
2929

3030
# Number of seconds expected to complete container startup including bootstrap.
31-
STARTUP_TIME="${STARTUP_TIME:-1}"
31+
STARTUP_TIME="${STARTUP_TIME:-2}"
32+
33+
# Docker --sysctl settings
34+
SYSCTL_NET_CORE_SOMAXCONN="${SYSCTL_NET_CORE_SOMAXCONN:-1024}"
35+
SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE="${SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE:-1024 65535}"
36+
SYSCTL_NET_IPV4_ROUTE_FLUSH="${SYSCTL_NET_IPV4_ROUTE_FLUSH:-1}"
3237

3338
# ETCD register service settings
3439
REGISTER_ETCD_PARAMETERS="${REGISTER_ETCD_PARAMETERS:-}"

src/opt/scmi/service-unit.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ readonly SERVICE_UNIT_ENVIRONMENT_KEYS="
1414
REDIS_MAXMEMORY_SAMPLES
1515
REDIS_OPTIONS
1616
REDIS_TCP_BACKLOG
17+
SYSCTL_NET_CORE_SOMAXCONN
18+
SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE
19+
SYSCTL_NET_IPV4_ROUTE_FLUSH
1720
"
1821
readonly SERVICE_UNIT_REGISTER_ENVIRONMENT_KEYS="
1922
REGISTER_ETCD_PARAMETERS
@@ -24,4 +27,4 @@ readonly SERVICE_UNIT_REGISTER_ENVIRONMENT_KEYS="
2427
# -----------------------------------------------------------------------------
2528
# Variables
2629
# -----------------------------------------------------------------------------
27-
SERVICE_UNIT_INSTALL_TIMEOUT=${SERVICE_UNIT_INSTALL_TIMEOUT:-4}
30+
SERVICE_UNIT_INSTALL_TIMEOUT=${SERVICE_UNIT_INSTALL_TIMEOUT:-5}

0 commit comments

Comments
 (0)