blob: 8f1f55d0c61ec7c5defb6a06e66be443f2157aaf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
Name: redis
Version:6.2.5
Release: 1%{?dist}
Summary:redis
Group:Applications/Archiving
License:GPL
URL: http://redis.io
Source0:redis-6.2.5.tar.gz
BuildRequires: gcc
Requires: bash,jemalloc
%description
redis server and client
%prep
%setup -q
mkdir -p /usr/local/redis/conf
mkdir -p /usr/local/redis/data
mkdir -p /usr/local/redis/logs
%build
make %{?_smp_mflags}
%install
rm -rf
make install PREFIX=%{buildroot}/usr/local/redis
%files
/usr/local/redis
%doc
%post
mkdir -p /usr/local/redis/{conf,data,logs}
echo "[Unit]
Description=Redis server v6.2.5 daemon
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf --daemonize yes
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/usr/local/redis/bin/redis-cli -p 6379 shutdown
User=root
Group=root
PrivateTmp=true
[Install]
WantedBy=multi-user.target" > /usr/lib/systemd/system/redis-server.service
echo 'daemonize yes
pidfile /var/run/redis/redis.pid
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 0
loglevel notice
logfile "/usr/local/redis/logs/redis.log"
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /usr/local/redis/data
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
bind 127.0.0.1
appendonly yes
appendfsync no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
' > /usr/local/redis/conf/redis.conf
chown -R root:root /usr/local/redis
systemctl daemon-reload
systemctl start redis-server.service > /dev/null 2>&1
systemctl enable redis-server.service > /dev/null 2>&1
%changelog
%clean
%preun
#/usr/local/redis/bin/redis-cli shutdown
%postun
rm -rf /usr/local/redis
rm -rf /etc/systemd/system/multi-user.target.wants/redis-server.service
rm -rf /usr/lib/systemd/system/redis-server.service
|