[root@localhost redis-5.0.5]# make
cd src && make all
make[1]: Entering directory `/soft/redis-5.0.5/src'
CC Makefile.dep
make[1]: Leaving directory `/soft/redis-5.0.5/src'
make[1]: Entering directory `/soft/redis-5.0.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory `/soft/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/soft/redis-5.0.5/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W -Wno-missing-field-initializers >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC='' -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[2]: Entering directory `/soft/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/soft/redis-5.0.5/deps/hiredis'
gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
make[3]: gcc: Command not found
make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/soft/redis-5.0.5/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/soft/redis-5.0.5/deps'
make[1]: [persist-settings] Error 2 (ignored)
CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/soft/redis-5.0.5/src'
make: *** [all] Error 2
[root@localhost redis-5.0.5]# yum install -y gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* extras: mirrors.163.com
* updates: mirrors.njupt.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-44.el7 will be installed
--> Processing Dependency: libgomp = 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: cpp = 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: libgcc >= 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-44.el7.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-44.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-326.el7_9 will be installed
--> Processing Dependency: glibc-headers = 2.17-326.el7_9 for package: glibc-devel-2.17-326.el7_9.x86_64
--> Processing Dependency: glibc = 2.17-326.el7_9 for package: glibc-devel-2.17-326.el7_9.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-326.el7_9.x86_64
---> Package libgcc.x86_64 0:4.8.5-39.el7 will be updated
---> Package libgcc.x86_64 0:4.8.5-44.el7 will be an update
---> Package libgomp.x86_64 0:4.8.5-39.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-44.el7 will be an update
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.17-307.el7.1 will be updated
--> Processing Dependency: glibc = 2.17-307.el7.1 for package: glibc-common-2.17-307.el7.1.x86_64
---> Package glibc.x86_64 0:2.17-326.el7_9 will be an update
---> Package glibc-headers.x86_64 0:2.17-326.el7_9 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-326.el7_9.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-326.el7_9.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-307.el7.1 will be updated
---> Package glibc-common.x86_64 0:2.17-326.el7_9 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-1160.66.1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================================================================
Installing:
gcc x86_64 4.8.5-44.el7 base 16 M
Installing for dependencies:
cpp x86_64 4.8.5-44.el7 base 5.9 M
glibc-devel x86_64 2.17-326.el7_9 updates 1.1 M
glibc-headers x86_64 2.17-326.el7_9 updates 691 k
kernel-headers x86_64 3.10.0-1160.66.1.el7 updates 9.1 M
libmpc x86_64 1.0.1-3.el7 base 51 k
mpfr x86_64 3.1.1-4.el7 base 203 k
Updating for dependencies:
glibc x86_64 2.17-326.el7_9 updates 3.6 M
glibc-common x86_64 2.17-326.el7_9 updates 12 M
libgcc x86_64 4.8.5-44.el7 base 103 k
libgomp x86_64 4.8.5-44.el7 base 159 k
Transaction Summary
=================================================================================================================================================================================================================
Install 1 Package (+6 Dependent packages)
Upgrade ( 4 Dependent packages)
Total download size: 49 M
Downloading packages:
No Presto metadata available for base
No Presto metadata available for updates
(1/11): glibc-devel-2.17-326.el7_9.x86_64.rpm | 1.1 MB 00:00:00
(2/11): glibc-headers-2.17-326.el7_9.x86_64.rpm | 691 kB 00:00:00
(3/11): kernel-headers-3.10.0-1160.66.1.el7.x86_64.rpm | 9.1 MB 00:00:02
(4/11): libgcc-4.8.5-44.el7.x86_64.rpm | 103 kB 00:00:00
(5/11): libgomp-4.8.5-44.el7.x86_64.rpm | 159 kB 00:00:00
(6/11): libmpc-1.0.1-3.el7.x86_64.rpm | 51 kB 00:00:00
(7/11): glibc-common-2.17-326.el7_9.x86_64.rpm | 12 MB 00:00:04
(8/11): mpfr-3.1.1-4.el7.x86_64.rpm | 203 kB 00:00:00
(9/11): glibc-2.17-326.el7_9.x86_64.rpm | 3.6 MB 00:00:10
(10/11): cpp-4.8.5-44.el7.x86_64.rpm | 5.9 MB 00:00:13
(11/11): gcc-4.8.5-44.el7.x86_64.rpm | 16 MB 00:00:13
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 3.6 MB/s | 49 MB 00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libgcc-4.8.5-44.el7.x86_64 1/15
Updating : glibc-2.17-326.el7_9.x86_64 2/15
Updating : glibc-common-2.17-326.el7_9.x86_64 3/15
Installing : mpfr-3.1.1-4.el7.x86_64 4/15
Installing : libmpc-1.0.1-3.el7.x86_64 5/15
Installing : cpp-4.8.5-44.el7.x86_64 6/15
Updating : libgomp-4.8.5-44.el7.x86_64 7/15
Installing : kernel-headers-3.10.0-1160.66.1.el7.x86_64 8/15
Installing : glibc-headers-2.17-326.el7_9.x86_64 9/15
Installing : glibc-devel-2.17-326.el7_9.x86_64 10/15
Installing : gcc-4.8.5-44.el7.x86_64 11/15
Cleanup : libgomp-4.8.5-39.el7.x86_64 12/15
Cleanup : glibc-2.17-307.el7.1.x86_64 13/15
Cleanup : glibc-common-2.17-307.el7.1.x86_64 14/15
Cleanup : libgcc-4.8.5-39.el7.x86_64 15/15
Verifying : glibc-common-2.17-326.el7_9.x86_64 1/15
Verifying : kernel-headers-3.10.0-1160.66.1.el7.x86_64 2/15
Verifying : glibc-2.17-326.el7_9.x86_64 3/15
Verifying : mpfr-3.1.1-4.el7.x86_64 4/15
Verifying : glibc-devel-2.17-326.el7_9.x86_64 5/15
Verifying : cpp-4.8.5-44.el7.x86_64 6/15
Verifying : glibc-headers-2.17-326.el7_9.x86_64 7/15
Verifying : gcc-4.8.5-44.el7.x86_64 8/15
Verifying : libmpc-1.0.1-3.el7.x86_64 9/15
Verifying : libgcc-4.8.5-44.el7.x86_64 10/15
Verifying : libgomp-4.8.5-44.el7.x86_64 11/15
Verifying : glibc-common-2.17-307.el7.1.x86_64 12/15
Verifying : libgcc-4.8.5-39.el7.x86_64 13/15
Verifying : libgomp-4.8.5-39.el7.x86_64 14/15
Verifying : glibc-2.17-307.el7.1.x86_64 15/15
Installed:
gcc.x86_64 0:4.8.5-44.el7
Dependency Installed:
cpp.x86_64 0:4.8.5-44.el7 glibc-devel.x86_64 0:2.17-326.el7_9 glibc-headers.x86_64 0:2.17-326.el7_9 kernel-headers.x86_64 0:3.10.0-1160.66.1.el7 libmpc.x86_64 0:1.0.1-3.el7 mpfr.x86_64 0:3.1.1-4.el7
Dependency Updated:
glibc.x86_64 0:2.17-326.el7_9 glibc-common.x86_64 0:2.17-326.el7_9 libgcc.x86_64 0:4.8.5-44.el7 libgomp.x86_64 0:4.8.5-44.el7
Complete!
[root@localhost redis-5.0.5]# make
cd src && make all
make[1]: Entering directory `/soft/redis-5.0.5/src'
CC Makefile.dep
make[1]: Leaving directory `/soft/redis-5.0.5/src'
make[1]: Entering directory `/soft/redis-5.0.5/src'
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
#include
^
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/soft/redis-5.0.5/src'
make: *** [all] Error 2
[root@localhost redis-5.0.5]# make distclean
cd src && make distclean
make[1]: Entering directory `/soft/redis-5.0.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory `/soft/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/soft/redis-5.0.5/deps'
(rm -f .make-*)
make[1]: Leaving directory `/soft/redis-5.0.5/src'
[root@localhost redis-5.0.5]# make
cd src && make all
make[1]: Entering directory `/soft/redis-5.0.5/src'
CC Makefile.dep
make[1]: Leaving directory `/soft/redis-5.0.5/src'
make[1]: Entering directory `/soft/redis-5.0.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory `/soft/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/soft/redis-5.0.5/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W -Wno-missing-field-initializers >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC='' -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[2]: Entering directory `/soft/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/soft/redis-5.0.5/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb sds.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb async.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb read.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o read.o
make[3]: Leaving directory `/soft/redis-5.0.5/deps/hiredis'
MAKE linenoise
cd linenoise && make
make[3]: Entering directory `/soft/redis-5.0.5/deps/linenoise'
cc -Wall -Os -g -c linenoise.c
make[3]: Leaving directory `/soft/redis-5.0.5/deps/linenoise'
MAKE lua
cd lua/src && make all CFLAGS="-O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' " MYLDFLAGS="" AR="ar rcu"
make[3]: Entering directory `/soft/redis-5.0.5/deps/lua/src'
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lapi.o lapi.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lcode.o lcode.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o ldebug.o ldebug.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o ldo.o ldo.c
ldo.c: In function ‘f_parser’:
ldo.c:496:7: warning: unused variable ‘c’ [-Wunused-variable]
int c = luaZ_lookahead(p->z);
^
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o ldump.o ldump.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lfunc.o lfunc.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lgc.o lgc.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o llex.o llex.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lmem.o lmem.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lobject.o lobject.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lopcodes.o lopcodes.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lparser.o lparser.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lstate.o lstate.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lstring.o lstring.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o ltable.o ltable.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o ltm.o ltm.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lundump.o lundump.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lvm.o lvm.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lzio.o lzio.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o strbuf.o strbuf.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o fpconv.o fpconv.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lauxlib.o lauxlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lbaselib.o lbaselib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o ldblib.o ldblib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o liolib.o liolib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lmathlib.o lmathlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o loslib.o loslib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o ltablib.o ltablib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lstrlib.o lstrlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o loadlib.o loadlib.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o linit.o linit.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lua_cjson.o lua_cjson.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lua_struct.o lua_struct.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lua_cmsgpack.o lua_cmsgpack.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lua_bit.o lua_bit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o strbuf.o fpconv.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o lua_cjson.o lua_struct.o lua_cmsgpack.o lua_bit.o # DLL needs all object files
ranlib liblua.a
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o lua.o lua.c
cc -o lua lua.o liblua.a -lm
liblua.a(loslib.o): In function `os_tmpname':
loslib.c:(.text+0x28c): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o luac.o luac.c
cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -c -o print.o print.c
cc -o luac luac.o print.o liblua.a -lm
make[3]: Leaving directory `/soft/redis-5.0.5/deps/lua/src'
MAKE jemalloc
cd jemalloc && ./configure --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS=""
configure: WARNING: unrecognized options: --enable-cc-silence
checking for xsltproc... /bin/xsltproc
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether compiler is cray... no
checking whether compiler supports -std=gnu11... yes
checking whether compiler supports -Wall... yes
checking whether compiler supports -Wshorten-64-to-32... no
checking whether compiler supports -Wsign-compare... yes
checking whether compiler supports -Wundef... yes
checking whether compiler supports -Wno-format-zero-length... yes
checking whether compiler supports -pipe... yes
checking whether compiler supports -g3... yes
checking how to run the C preprocessor... gcc -E
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking whether g++ supports C++14 features by default... no
checking whether g++ supports C++14 features with -std=c++14... no
checking whether g++ supports C++14 features with -std=c++0x... no
checking whether g++ supports C++14 features with +std=c++14... no
checking whether g++ supports C++14 features with -h std=c++14... no
configure: No compiler with C++14 support was found
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of intmax_t... 8
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether pause instruction is compilable... yes
checking number of significant virtual address bits... 48
checking for ar... ar
checking for nm... nm
checking for gawk... gawk
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking whether malloc_usable_size definition can use const argument... no
checking for library containing log... -lm
checking whether __attribute__ syntax is compilable... yes
checking whether compiler supports -fvisibility=hidden... yes
checking whether compiler supports -fvisibility=hidden... no
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether tls_model attribute is compilable... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether alloc_size attribute is compilable... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether format(gnu_printf, ...) attribute is compilable... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether format(printf, ...) attribute is compilable... yes
checking for a BSD-compatible install... /bin/install -c
checking for ranlib... ranlib
checking for ld... /bin/ld
checking for autoconf... false
checking for memalign... yes
checking for valloc... yes
checking whether compiler supports -O3... yes
checking whether compiler supports -O3... no
checking whether compiler supports -funroll-loops... yes
checking configured backtracing method... N/A
checking for sbrk... yes
checking whether utrace(2) is compilable... no
checking whether a program using __builtin_unreachable is compilable... yes
checking whether a program using __builtin_ffsl is compilable... yes
checking LG_PAGE... 12
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for dlsym... no
checking for dlsym in -ldl... yes
checking whether pthread_atfork(3) is compilable... yes
checking whether pthread_setname_np(3) is compilable... yes
checking for library containing clock_gettime... none required
checking whether clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is compilable... yes
checking whether clock_gettime(CLOCK_MONOTONIC, ...) is compilable... yes
checking whether mach_absolute_time() is compilable... no
checking whether compiler supports -Werror... yes
checking whether syscall(2) is compilable... yes
checking for secure_getenv... yes
checking for sched_getcpu... yes
checking for sched_setaffinity... yes
checking for issetugid... no
checking for _malloc_thread_cleanup... no
checking for _pthread_mutex_init_calloc_cb... no
checking for TLS... yes
checking whether C11 atomics is compilable... no
checking whether GCC __atomic atomics is compilable... yes
checking whether GCC __sync atomics is compilable... yes
checking whether Darwin OSAtomic*() is compilable... no
checking whether madvise(2) is compilable... yes
checking whether madvise(..., MADV_FREE) is compilable... no
checking whether madvise(..., MADV_DONTNEED) is compilable... yes
checking whether madvise(..., MADV_DO[NT]DUMP) is compilable... yes
checking whether madvise(..., MADV_[NO]HUGEPAGE) is compilable... yes
checking whether to force 32-bit __sync_{add,sub}_and_fetch()... no
checking whether to force 64-bit __sync_{add,sub}_and_fetch()... no
checking for __builtin_clz... yes
checking whether Darwin os_unfair_lock_*() is compilable... no
checking whether Darwin OSSpin*() is compilable... no
checking whether glibc malloc hook is compilable... yes
checking whether glibc memalign hook is compilable... yes
checking whether pthreads adaptive mutexes is compilable... yes
checking whether compiler supports -D_GNU_SOURCE... yes
checking whether compiler supports -Werror... yes
checking whether compiler supports -herror_on_warning... no
checking whether strerror_r returns char with gnu source is compilable... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating jemalloc.pc
config.status: creating doc/html.xsl
config.status: creating doc/manpages.xsl
config.status: creating doc/jemalloc.xml
config.status: creating include/jemalloc/jemalloc_macros.h
config.status: creating include/jemalloc/jemalloc_protos.h
config.status: creating include/jemalloc/jemalloc_typedefs.h
config.status: creating include/jemalloc/internal/jemalloc_preamble.h
config.status: creating test/test.sh
config.status: creating test/include/test/jemalloc_test.h
config.status: creating config.stamp
config.status: creating bin/jemalloc-config
config.status: creating bin/jemalloc.sh
config.status: creating bin/jeprof
config.status: creating include/jemalloc/jemalloc_defs.h
config.status: creating include/jemalloc/internal/jemalloc_internal_defs.h
config.status: creating test/include/test/jemalloc_test_defs.h
config.status: executing include/jemalloc/internal/public_symbols.txt commands
config.status: executing include/jemalloc/internal/private_symbols.awk commands
config.status: executing include/jemalloc/internal/private_symbols_jet.awk commands
config.status: executing include/jemalloc/internal/public_namespace.h commands
config.status: executing include/jemalloc/internal/public_unnamespace.h commands
config.status: executing include/jemalloc/internal/size_classes.h commands
config.status: executing include/jemalloc/jemalloc_protos_jet.h commands
config.status: executing include/jemalloc/jemalloc_rename.h commands
config.status: executing include/jemalloc/jemalloc_mangle.h commands
config.status: executing include/jemalloc/jemalloc_mangle_jet.h commands
config.status: executing include/jemalloc/jemalloc.h commands
configure: WARNING: unrecognized options: --enable-cc-silence
===============================================================================
jemalloc version : 5.1.0-0-g0
library revision : 2
CONFIG : --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --enable-cc-silence 'CFLAGS=-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops ' LDFLAGS=
CC : gcc
CONFIGURE_CFLAGS : -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -fvisibility=hidden -O3 -funroll-loops
SPECIFIED_CFLAGS : -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops
EXTRA_CFLAGS :
CPPFLAGS : -D_GNU_SOURCE -D_REENTRANT
CXX : g++
CONFIGURE_CXXFLAGS :
SPECIFIED_CXXFLAGS :
EXTRA_CXXFLAGS :
LDFLAGS :
EXTRA_LDFLAGS :
DSO_LDFLAGS : -shared -Wl,-soname,$(@F)
LIBS : -lm -lpthread -ldl
RPATH_EXTRA :
XSLTPROC : /bin/xsltproc
XSLROOT :
PREFIX : /usr/local
BINDIR : /usr/local/bin
DATADIR : /usr/local/share
INCLUDEDIR : /usr/local/include
LIBDIR : /usr/local/lib
MANDIR : /usr/local/share/man
srcroot :
abs_srcroot : /soft/redis-5.0.5/deps/jemalloc/
objroot :
abs_objroot : /soft/redis-5.0.5/deps/jemalloc/
JEMALLOC_PREFIX : je_
JEMALLOC_PRIVATE_NAMESPACE
: je_
install_suffix :
malloc_conf :
autogen : 0
debug : 0
stats : 1
prof : 0
prof-libunwind : 0
prof-libgcc : 0
prof-gcc : 0
fill : 1
utrace : 0
xmalloc : 0
log : 0
lazy_lock : 0
cache-oblivious : 1
cxx : 0
===============================================================================
cd jemalloc && make CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS="" lib/libjemalloc.a
make[3]: Entering directory `/soft/redis-5.0.5/deps/jemalloc'
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/jemalloc.sym.o src/jemalloc.c
nm -a src/jemalloc.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/jemalloc.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/arena.sym.o src/arena.c
nm -a src/arena.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/arena.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/background_thread.sym.o src/background_thread.c
nm -a src/background_thread.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/background_thread.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/base.sym.o src/base.c
nm -a src/base.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/base.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bin.sym.o src/bin.c
nm -a src/bin.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/bin.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bitmap.sym.o src/bitmap.c
nm -a src/bitmap.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/bitmap.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ckh.sym.o src/ckh.c
nm -a src/ckh.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ckh.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ctl.sym.o src/ctl.c
nm -a src/ctl.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ctl.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/div.sym.o src/div.c
nm -a src/div.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/div.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent.sym.o src/extent.c
nm -a src/extent.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent_dss.sym.o src/extent_dss.c
nm -a src/extent_dss.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent_dss.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent_mmap.sym.o src/extent_mmap.c
nm -a src/extent_mmap.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent_mmap.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/hash.sym.o src/hash.c
nm -a src/hash.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/hash.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/hooks.sym.o src/hooks.c
nm -a src/hooks.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/hooks.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/large.sym.o src/large.c
nm -a src/large.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/large.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/log.sym.o src/log.c
nm -a src/log.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/log.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/malloc_io.sym.o src/malloc_io.c
nm -a src/malloc_io.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/malloc_io.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/mutex.sym.o src/mutex.c
nm -a src/mutex.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/mutex.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/mutex_pool.sym.o src/mutex_pool.c
nm -a src/mutex_pool.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/mutex_pool.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/nstime.sym.o src/nstime.c
nm -a src/nstime.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/nstime.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/pages.sym.o src/pages.c
nm -a src/pages.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/pages.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/prng.sym.o src/prng.c
nm -a src/prng.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/prng.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/prof.sym.o src/prof.c
nm -a src/prof.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/prof.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/rtree.sym.o src/rtree.c
nm -a src/rtree.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/rtree.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/stats.sym.o src/stats.c
nm -a src/stats.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/stats.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/sz.sym.o src/sz.c
nm -a src/sz.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/sz.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/tcache.sym.o src/tcache.c
nm -a src/tcache.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/tcache.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ticker.sym.o src/ticker.c
nm -a src/ticker.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ticker.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/tsd.sym.o src/tsd.c
nm -a src/tsd.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/tsd.sym
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/witness.sym.o src/witness.c
nm -a src/witness.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/witness.sym
/bin/sh include/jemalloc/internal/private_namespace.sh src/jemalloc.sym src/arena.sym src/background_thread.sym src/base.sym src/bin.sym src/bitmap.sym src/ckh.sym src/ctl.sym src/div.sym src/extent.sym src/extent_dss.sym src/extent_mmap.sym src/hash.sym src/hooks.sym src/large.sym src/log.sym src/malloc_io.sym src/mutex.sym src/mutex_pool.sym src/nstime.sym src/pages.sym src/prng.sym src/prof.sym src/rtree.sym src/stats.sym src/sz.sym src/tcache.sym src/ticker.sym src/tsd.sym src/witness.sym > include/jemalloc/internal/private_namespace.gen.h
cp include/jemalloc/internal/private_namespace.gen.h include/jemalloc/internal/private_namespace.gen.h
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/jemalloc.o src/jemalloc.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/arena.o src/arena.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/background_thread.o src/background_thread.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/base.o src/base.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bin.o src/bin.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bitmap.o src/bitmap.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ckh.o src/ckh.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ctl.o src/ctl.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/div.o src/div.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent.o src/extent.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent_dss.o src/extent_dss.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent_mmap.o src/extent_mmap.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hash.o src/hash.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hooks.o src/hooks.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/large.o src/large.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/log.o src/log.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/malloc_io.o src/malloc_io.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex.o src/mutex.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex_pool.o src/mutex_pool.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/nstime.o src/nstime.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/pages.o src/pages.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prng.o src/prng.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prof.o src/prof.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/rtree.o src/rtree.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/stats.o src/stats.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/sz.o src/sz.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tcache.o src/tcache.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ticker.o src/ticker.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tsd.o src/tsd.c
gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/witness.o src/witness.c
ar crus lib/libjemalloc.a src/jemalloc.o src/arena.o src/background_thread.o src/base.o src/bin.o src/bitmap.o src/ckh.o src/ctl.o src/div.o src/extent.o src/extent_dss.o src/extent_mmap.o src/hash.o src/hooks.o src/large.o src/log.o src/malloc_io.o src/mutex.o src/mutex_pool.o src/nstime.o src/pages.o src/prng.o src/prof.o src/rtree.o src/stats.o src/sz.o src/tcache.o src/ticker.o src/tsd.o src/witness.o
make[3]: Leaving directory `/soft/redis-5.0.5/deps/jemalloc'
make[2]: Leaving directory `/soft/redis-5.0.5/deps'
CC adlist.o
CC quicklist.o
CC ae.o
CC anet.o
CC dict.o
CC server.o
CC sds.o
CC zmalloc.o
CC lzf_c.o
CC lzf_d.o
CC pqsort.o
CC zipmap.o
CC sha1.o
CC ziplist.o
CC release.o
CC networking.o
CC util.o
CC object.o
CC db.o
CC replication.o
CC rdb.o
CC t_string.o
CC t_list.o
CC t_set.o
CC t_zset.o
CC t_hash.o
CC config.o
CC aof.o
CC pubsub.o
CC multi.o
CC debug.o
CC sort.o
CC intset.o
CC syncio.o
CC cluster.o
CC crc16.o
CC endianconv.o
CC slowlog.o
CC scripting.o
CC bio.o
CC rio.o
CC rand.o
CC memtest.o
CC crc64.o
CC bitops.o
CC sentinel.o
CC notify.o
CC setproctitle.o
CC blocked.o
CC hyperloglog.o
CC latency.o
CC sparkline.o
CC redis-check-rdb.o
CC redis-check-aof.o
CC geo.o
CC lazyfree.o
CC module.o
CC evict.o
CC expire.o
CC geohash.o
CC geohash_helper.o
CC childinfo.o
CC defrag.o
CC siphash.o
CC rax.o
CC t_stream.o
CC listpack.o
CC localtime.o
CC lolwut.o
CC lolwut5.o
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
INSTALL redis-check-rdb
INSTALL redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/soft/redis-5.0.5/src'
[root@localhost redis-5.0.5]# cd src
[root@localhost src]# ls
adlist.c atomicvar.h crc16.c endianconv.h help.h localtime.o module.o quicklist.h redis-check-aof replication.c setproctitle.c stream.h util.c
adlist.h bio.c crc16.o endianconv.o hyperloglog.c lolwut5.c modules quicklist.o redis-check-aof.c replication.o setproctitle.o syncio.c util.h
adlist.o bio.h crc64.c evict.c hyperloglog.o lolwut5.o multi.c rand.c redis-check-aof.o rio.c sha1.c syncio.o util.o
ae.c bio.o crc64.h evict.o intset.c lolwut.c multi.o rand.h redis-check-rdb rio.h sha1.h testhelp.h valgrind.sup
ae_epoll.c bitops.c crc64.o expire.c intset.h lolwut.o networking.c rand.o redis-check-rdb.c rio.o sha1.o t_hash.c version.h
ae_evport.c bitops.o db.c expire.o intset.o lzf_c.c networking.o rax.c redis-check-rdb.o scripting.c siphash.c t_hash.o ziplist.c
ae.h blocked.c db.o fmacros.h latency.c lzf_c.o notify.c rax.h redis-cli scripting.o siphash.o t_list.c ziplist.h
ae_kqueue.c blocked.o debug.c geo.c latency.h lzf_d.c notify.o rax_malloc.h redis-cli.c sdsalloc.h slowlog.c t_list.o ziplist.o
ae.o childinfo.c debugmacro.h geo.h latency.o lzf_d.o object.c rax.o redis-cli.o sds.c slowlog.h t_set.c zipmap.c
ae_select.c childinfo.o debug.o geohash.c lazyfree.c lzf.h object.o rdb.c redismodule.h sds.h slowlog.o t_set.o zipmap.h
anet.c cluster.c defrag.c geohash.h lazyfree.o lzfP.h pqsort.c rdb.h redis-sentinel sds.o solarisfixes.h t_stream.c zipmap.o
anet.h cluster.h defrag.o geohash_helper.c listpack.c Makefile pqsort.h rdb.o redis-server sentinel.c sort.c t_stream.o zmalloc.c
anet.o cluster.o dict.c geohash_helper.h listpack.h memtest.c pqsort.o redisassert.h redis-trib.rb sentinel.o sort.o t_string.c zmalloc.h
aof.c config.c dict.h geohash_helper.o listpack_malloc.h memtest.o pubsub.c redis-benchmark release.c server.c sparkline.c t_string.o zmalloc.o
aof.o config.h dict.o geohash.o listpack.o mkreleasehdr.sh pubsub.o redis-benchmark.c release.h server.h sparkline.h t_zset.c
asciilogo.h config.o endianconv.c geo.o localtime.c module.c quicklist.c redis-benchmark.o release.o server.o sparkline.o t_zset.o
[root@localhost src]# ./redis-server
25367:C 05 Jun 2022 05:35:12.409 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25367:C 05 Jun 2022 05:35:12.409 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=25367, just started
25367:C 05 Jun 2022 05:35:12.409 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
25367:M 05 Jun 2022 05:35:12.410 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.5 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 25367
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
25367:M 05 Jun 2022 05:35:12.412 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
25367:M 05 Jun 2022 05:35:12.412 # Server initialized
25367:M 05 Jun 2022 05:35:12.412 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
25367:M 05 Jun 2022 05:35:12.412 * Ready to accept connections
25367:M 05 Jun 2022 05:39:41.596 * DB saved on disk
25367:M 05 Jun 2022 05:39:41.596 # Redis is now ready to exit, bye bye...
[root@localhost src]# cd ..
[root@localhost redis-5.0.5]# make install PREFIX=/opt/soft/redis5
cd src && make install
make[1]: Entering directory `/soft/redis-5.0.5/src'
CC Makefile.dep
make[1]: Leaving directory `/soft/redis-5.0.5/src'
make[1]: Entering directory `/soft/redis-5.0.5/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/soft/redis-5.0.5/src'
[root@localhost redis-5.0.5]# cd /opt/soft/redis5/bin
[root@localhost bin]# ll
total 32736
-rwxr-xr-x. 1 root root 4366552 Jun 5 05:41 redis-benchmark
-rwxr-xr-x. 1 root root 8111800 Jun 5 05:41 redis-check-aof
-rwxr-xr-x. 1 root root 8111800 Jun 5 05:41 redis-check-rdb
-rwxr-xr-x. 1 root root 4806768 Jun 5 05:41 redis-cli
lrwxrwxrwx. 1 root root 12 Jun 5 05:41 redis-sentinel -> redis-server
-rwxr-xr-x. 1 root root 8111800 Jun 5 05:41 redis-server
[root@localhost bin]# ./redis-server
25561:C 05 Jun 2022 05:42:59.361 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25561:C 05 Jun 2022 05:42:59.361 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=25561, just started
25561:C 05 Jun 2022 05:42:59.361 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
25561:M 05 Jun 2022 05:42:59.362 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.5 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 25561
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
25561:M 05 Jun 2022 05:42:59.363 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
25561:M 05 Jun 2022 05:42:59.363 # Server initialized
25561:M 05 Jun 2022 05:42:59.363 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
25561:M 05 Jun 2022 05:42:59.363 * Ready to accept connections
[root@localhost bin]# cd /soft/redis-5.0.5/utils/
[root@localhost utils]# ll
total 52
-rw-rw-r--. 1 root root 593 May 15 2019 build-static-symbols.tcl
-rw-rw-r--. 1 root root 1303 May 15 2019 cluster_fail_time.tcl
-rw-rw-r--. 1 root root 1098 May 15 2019 corrupt_rdb.c
drwxrwxr-x. 2 root root 60 May 15 2019 create-cluster
-rwxrwxr-x. 1 root root 2149 May 15 2019 generate-command-help.rb
drwxrwxr-x. 3 root root 31 May 15 2019 graphs
drwxrwxr-x. 2 root root 39 May 15 2019 hashtable
drwxrwxr-x. 2 root root 70 May 15 2019 hyperloglog
-rwxrwxr-x. 1 root root 9567 May 15 2019 install_server.sh
drwxrwxr-x. 2 root root 63 May 15 2019 lru
-rw-rw-r--. 1 root root 1277 May 15 2019 redis-copy.rb
-rwxrwxr-x. 1 root root 1352 May 15 2019 redis_init_script
-rwxrwxr-x. 1 root root 1047 May 15 2019 redis_init_script.tpl
-rw-rw-r--. 1 root root 1762 May 15 2019 redis-sha1.rb
drwxrwxr-x. 2 root root 135 May 15 2019 releasetools
-rwxrwxr-x. 1 root root 3787 May 15 2019 speed-regression.tcl
-rwxrwxr-x. 1 root root 693 May 15 2019 whatisdoing.sh
[root@localhost utils]# vi /etc/profile
export REDIS_HOME=/opt/soft/redis5
export PATH=$PATH:$REDIS_HOME/bin
[root@localhost utils]# source /etc/profile
[root@localhost utils]# echo $PATH
/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/soft/redis5/bin
[root@localhost utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/opt/soft/redis5/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /opt/soft/redis5/bin/redis-server
Cli Executable : /opt/soft/redis5/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig! ----->开机启动
Successfully added to runlevels 345!
Starting Redis server... ----> 启动了redis
Installation successful!
[root@localhost utils]# cd /etc/init.d
[root@localhost init.d]# ls
functions netconsole network README redis_6379
[root@localhost init.d]# cd
[root@localhost ~]# service redis_6379 status
Redis is running (25648)
[root@localhost ~]# cd /soft/redis-5.0.5/utils
[root@localhost utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379] 6380
Please select the redis config file name [/etc/redis/6380.conf]
Selected default - /etc/redis/6380.conf
Please select the redis log file name [/var/log/redis_6380.log]
Selected default - /var/log/redis_6380.log
Please select the data directory for this instance [/var/lib/redis/6380]
Selected default - /var/lib/redis/6380
Please select the redis executable path [/opt/soft/redis5/bin/redis-server]
Selected config:
Port : 6380
Config file : /etc/redis/6380.conf
Log file : /var/log/redis_6380.log
Data dir : /var/lib/redis/6380
Executable : /opt/soft/redis5/bin/redis-server
Cli Executable : /opt/soft/redis5/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6380.conf => /etc/init.d/redis_6380
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
[root@localhost utils]# service redis_6380 status
Redis is running (25749)
[root@localhost utils]# ps -fe | grep redis
root 25648 1 0 05:58 ? 00:00:00 /opt/soft/redis5/bin/redis-server 127.0.0.1:6379
root 25749 1 0 06:07 ? 00:00:00 /opt/soft/redis5/bin/redis-server 127.0.0.1:6380
root 25763 2104 0 06:08 pts/0 00:00:00 grep --color=auto redis
[root@localhost ~]# service redis_6380 stop
Stopping ...
Redis stopped
[root@localhost ~]# ps -fe | grep redis
root 696 1 0 06:16 ? 00:00:00 /opt/soft/redis5/bin/redis-server 127.0.0.1:6379
root 996 962 0 06:19 pts/0 00:00:00 grep --color=auto redis
[root@localhost ~]# service redis_6380 start
Starting Redis server...
[root@localhost ~]# service redis_6380 status
Redis is running (1018)
[root@localhost ~]# ps -fe | grep redis
root 696 1 0 06:16 ? 00:00:00 /opt/soft/redis5/bin/redis-server 127.0.0.1:6379
root 1018 1 0 06:19 ? 00:00:00 /opt/soft/redis5/bin/redis-server 127.0.0.1:6380
root 1032 962 0 06:20 pts/0 00:00:00 grep --color=auto redis
[root@localhost ~]# ps -fe | grep redis
root 696 1 0 06:16 ? 00:00:00 /opt/soft/redis5/bin/redis-server 127.0.0.1:6379
root 1018 1 0 06:19 ? 00:00:00 /opt/soft/redis5/bin/redis-server 127.0.0.1:6380
root 1076 962 0 06:38 pts/0 00:00:00 grep --color=auto redis
[root@localhost ~]# cd /proc/696/fd
[root@localhost fd]# ll
total 0
lrwx------. 1 root root 64 Jun 5 06:38 0 -> /dev/null
lrwx------. 1 root root 64 Jun 5 06:38 1 -> /dev/null
lrwx------. 1 root root 64 Jun 5 06:38 2 -> /dev/null
lr-x------. 1 root root 64 Jun 5 06:38 3 -> pipe:[15879]
l-wx------. 1 root root 64 Jun 5 06:38 4 -> pipe:[15879]
lrwx------. 1 root root 64 Jun 5 06:38 5 -> anon_inode:[eventpoll]
lrwx------. 1 root root 64 Jun 5 06:38 6 -> socket:[15902]
[root@localhost fd]# redis-cli -p 6380
127.0.0.1:6380> set k380:1 hello
OK
127.0.0.1:6380> get k380:1
"hello"
127.0.0.1:6380> select 8
OK
127.0.0.1:6380[8]> get k380:1
(nil)
127.0.0.1:6380[8]> exit
[root@localhost fd]# redis-cli -p 6380 -n 8
127.0.0.1:6380[8]> exit
[root@localhost fd]# redis-cli
127.0.0.1:6379> help set
SET key value [expiration EX seconds|PX milliseconds] [NX|XX]
summary: Set the string value of a key
since: 1.0.0
group: string
127.0.0.1:6379> set k1 ooxx nx --> 只支持新增
OK
127.0.0.1:6379> get k1
"ooxx"
127.0.0.1:6379> set k1 xxoo nx
(nil)
127.0.0.1:6379> get k1
"ooxx"
127.0.0.1:6379> set k2 ooxx xx -->只支持修改
(nil)
127.0.0.1:6379> get k2
(nil)
127.0.0.1:6379> mset k3 a k4 b
OK
127.0.0.1:6379> mget k3 k4
1) "a"
2) "b"
127.0.0.1:6379> get k1
"ooxx"
127.0.0.1:6379> append k1 " world"
(integer) 10
127.0.0.1:6379> get k1
"ooxx world"
127.0.0.1:6379> getrange k1 5 9
"world"
127.0.0.1:6379> getrange k1 5 -1
"world"
127.0.0.1:6379> getrange k1 0 -1
"ooxx world"
127.0.0.1:6379> setrange k1 5 "chenjingjing"
(integer) 17
127.0.0.1:6379> get k1
"ooxx chenjingjing"
127.0.0.1:6379> strlen k1
(integer) 17
127.0.0.1:6379> get k1
"ooxx chenjingjing"
127.0.0.1:6379> type k1
string
127.0.0.1:6379> object encoding k1
"raw"
127.0.0.1:6379> get k1
"ooxx chenjingjing"
127.0.0.1:6379> set k2 hello
OK
127.0.0.1:6379> object encoding k2
"embstr"
127.0.0.1:6379> set k3 99
OK
127.0.0.1:6379> object encoding k3
"int"
127.0.0.1:6379> incr k3
(integer) 100
127.0.0.1:6379> incrby k3 22
(integer) 122
127.0.0.1:6379> decr k3
(integer) 121
127.0.0.1:6379> decrby k3 22
(integer) 99
127.0.0.1:6379> incrbyfloat k3 0.5
"99.5"
127.0.0.1:6379> set k1 hello
OK
127.0.0.1:6379> strlen k1
(integer) 5
127.0.0.1:6379> set k2 9
OK
127.0.0.1:6379> object encoding k2
"int"
127.0.0.1:6379> strlen k2
(integer) 1
127.0.0.1:6379> append k2 999
(integer) 4
127.0.0.1:6379> object encoding k2
"raw"
127.0.0.1:6379> incr k2
(integer) 10000
127.0.0.1:6379> object encoding k2
"int"
127.0.0.1:6379> set k3 中
OK
127.0.0.1:6379> get k3
"\xe4\xb8\xad"
127.0.0.1:6379> strlen k3
(integer) 3
127.0.0.1:6379> exit
[root@localhost fd]# redis-cli --raw
127.0.0.1:6379> get k3
中
127.0.0.1:6379> strlen k3
3
[root@localhost fd]# redis-cli
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> msetnx k1 a k2 b
(integer) 1
127.0.0.1:6379> mget k1 k2
1) "a"
2) "b"
127.0.0.1:6379> msetnx k2 c k3 d -->原子性
(integer) 0
127.0.0.1:6379> mget k1 k2 k3
1) "a"
2) "b"
3) (nil)
127.0.0.1:6379> keys *
1) "k1"
2) "k2"
127.0.0.1:6379> help setbit
SETBIT key offset value
summary: Sets or clears the bit at offset in the string value stored at key
since: 2.2.0
group: string
127.0.0.1:6379> setbit k1 1 1
(integer) 0
127.0.0.1:6379> strlen 1
(integer) 0
127.0.0.1:6379> strlen k1
(integer) 1
127.0.0.1:6379> get k1
"@"
127.0.0.1:6379> setbit k1 7 1
(integer) 0
127.0.0.1:6379> strlen k1
(integer) 1
127.0.0.1:6379> get k1
"A"
127.0.0.1:6379> setbit k1 9 1
(integer) 0
127.0.0.1:6379> get k1
"A@"
127.0.0.1:6379> help bitpos
BITPOS key bit [start] [end]
summary: Find first bit set or clear in a string
since: 2.8.7
group: string
127.0.0.1:6379> bitpos k1 1 0 0
(integer) 1
127.0.0.1:6379> bitpos k1 1 1 1
(integer) 9
127.0.0.1:6379> bitpos k1 1 0 1
(integer) 1
127.0.0.1:6379> bitcount k1 0 1
(integer) 3
127.0.0.1:6379> bitcount k1 1 1
(integer) 1
127.0.0.1:6379>
127.0.0.1:6379> bitcount k1 0 0
(integer) 2
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> setbit k1 1 1
(integer) 0
127.0.0.1:6379> setbit k1 7 1
(integer) 0
127.0.0.1:6379> get k1
"A"
127.0.0.1:6379> setbit k2 1 1
(integer) 0
127.0.0.1:6379> setbit k2 6 1
(integer) 0
127.0.0.1:6379> get k2
"B"
127.0.0.1:6379> bitop and andkey k1 k2
(integer) 1
127.0.0.1:6379> get andkey
"@"
127.0.0.1:6379> bitop or orkey k1 k2
(integer) 1
127.0.0.1:6379> get orkey
"C"
127.0.0.1:6379> setbit jingjing 1 1
(integer) 0
127.0.0.1:6379> setbit jingjing 7 1
(integer) 0
127.0.0.1:6379> setbit jingjing 364 1
(integer) 0
127.0.0.1:6379> strlen jingjing
(integer) 46
127.0.0.1:6379> bitcount jingjing -2 -1
(integer) 1
127.0.0.1:6379>
127.0.0.1:6379> setbit 20220605 1 1
(integer) 0
127.0.0.1:6379> setbit 20220606 1 1
(integer) 0
127.0.0.1:6379> setbit 20220607 7 1
(integer) 0
127.0.0.1:6379> bitop or destkey 20220605 20220607
(integer) 1
127.0.0.1:6379> bitcount destkey 0 -1
(integer) 2
127.0.0.1:6379> lpush k1 a b c d e f
(integer) 6
127.0.0.1:6379> rpush k2 a b c d e f
(integer) 6
127.0.0.1:6379> lpop k1
"f"
127.0.0.1:6379> lpop k1
"e"
127.0.0.1:6379> rpop k1
"a"
127.0.0.1:6379> lrange k1 0 -1
1) "d"
2) "c"
3) "b"
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> lpush k1 a b c d e f
(integer) 6
127.0.0.1:6379> lrange k1 0 -1
1) "f"
2) "e"
3) "d"
4) "c"
5) "b"
6) "a"
127.0.0.1:6379> lindex k1 2
"d"
127.0.0.1:6379> lindex k1 -1
"a"
127.0.0.1:6379> lset k1 3 xxxxx
OK
127.0.0.1:6379> lrange k1 0 -1
1) "f"
2) "e"
3) "d"
4) "xxxxx"
5) "b"
6) "a"
127.0.0.1:6379> lpush k3 1 a 2 b 3 a 4 c 5 a 6 d
(integer) 12
127.0.0.1:6379> lrange k3 0 -1
1) "d"
2) "6"
3) "a"
4) "5"
5) "c"
6) "4"
7) "a"
8) "3"
9) "b"
10) "2"
11) "a"
12) "1"
127.0.0.1:6379> lrem k3 2 a
(integer) 2
127.0.0.1:6379> lrange k3 0 -1
1) "d"
2) "6"
3) "5"
4) "c"
5) "4"
6) "3"
7) "b"
8) "2"
9) "a"
10) "1"
127.0.0.1:6379> linsert k3 after 6 a
(integer) 11
127.0.0.1:6379> linsert k3 before 3 a
(integer) 12
127.0.0.1:6379> lrange k3 0 -1
1) "d"
2) "6"
3) "a"
4) "5"
5) "c"
6) "4"
7) "a"
8) "3"
9) "b"
10) "2"
11) "a"
12) "1"
127.0.0.1:6379> lrem k3 -2 a
(integer) 2
127.0.0.1:6379> lrange k3 0 -1
1) "d"
2) "6"
3) "a"
4) "5"
5) "c"
6) "4"
7) "3"
8) "b"
9) "2"
10) "1"
127.0.0.1:6379> blpop ooxx 0 --> 窗口1 timeout 0 不超时
1) "ooxx"
2) "hello"
(287.37s)
127.0.0.1:6379> blpop ooxx 0 --> 窗口2 timeout 0 不超时
1) "ooxx"
2) "world"
(236.10s)
127.0.0.1:6379> rpush ooxx hello
(integer) 1
127.0.0.1:6379> rpush ooxx world
(integer) 1
127.0.0.1:6379> rpush k4 1 a 2 b 3 c 4 d 5 e 6 f
(integer) 12
127.0.0.1:6379> ltrim k4 0 -1 --> 删两端
OK
127.0.0.1:6379> lrange k4 0 -1
1) "1"
2) "a"
3) "2"
4) "b"
5) "3"
6) "c"
7) "4"
8) "d"
9) "5"
10) "e"
11) "6"
12) "f"
127.0.0.1:6379> ltrim k4 2 -2
OK
127.0.0.1:6379> lrange k4 0 -1
1) "2"
2) "b"
3) "3"
4) "c"
5) "4"
6) "d"
7) "5"
8) "e"
9) "6"
127.0.0.1:6379> hset tom name jz
(integer) 1
127.0.0.1:6379> hset tom age 18 address sh
(integer) 2
127.0.0.1:6379> hget tom name
"jz"
127.0.0.1:6379> hmget tom name age
1) "jz"
2) "18"
127.0.0.1:6379> hkeys tom
1) "name"
2) "age"
3) "address"
127.0.0.1:6379> hvals tom
1) "jz"
2) "18"
3) "sh"
127.0.0.1:6379> hgetall tom
1) "name"
2) "jz"
3) "age"
4) "18"
5) "address"
6) "sh"
127.0.0.1:6379> hincrbyfloat tom age 0.5
"18.5"
127.0.0.1:6379> hincrbyfloat tom age -1
"17.5"
127.0.0.1:6379> hget tom age
"17.5"
127.0.0.1:6379> sadd k1 tom jerry peter jkl tom sean
(integer) 5
127.0.0.1:6379> smembers k1
1) "tom"
2) "jkl"
3) "peter"
4) "sean"
5) "jerry"
127.0.0.1:6379> srem k1 jkl sean
(integer) 2
127.0.0.1:6379> smembers k1
1) "peter"
2) "tom"
3) "jerry"
127.0.0.1:6379> sadd k2 1 2 3 4 5
(integer) 5
127.0.0.1:6379> sadd k3 4 5 6 7 8
(integer) 5
127.0.0.1:6379> sinter k2 k3
1) "4"
2) "5"
127.0.0.1:6379> sinterstore dest k2 k3
(integer) 2
127.0.0.1:6379> smembers dest
1) "4"
2) "5"
127.0.0.1:6379> sunion k2 k3
1) "1"
2) "2"
3) "3"
4) "4"
5) "5"
6) "6"
7) "7"
8) "8"
127.0.0.1:6379> sdiff k2 k3
1) "1"
2) "2"
3) "3"
127.0.0.1:6379> sdiff k3 k2
1) "6"
2) "7"
3) "8"
127.0.0.1:6379> srandmember k2 3
1) "2"
2) "3"
3) "5"
127.0.0.1:6379> srandmember k2 7
1) "1"
2) "2"
3) "3"
4) "4"
5) "5"
127.0.0.1:6379> srandmember k2 -3
1) "4"
2) "5"
3) "2"
127.0.0.1:6379> srandmember k2 -7
1) "3"
2) "3"
3) "2"
4) "2"
5) "4"
6) "4"
7) "1"
127.0.0.1:6379> spop k2
"2"
127.0.0.1:6379> spop k2
"5"
127.0.0.1:6379> spop k2
"1"
127.0.0.1:6379> spop k2
"4"
127.0.0.1:6379> spop k2
"3"
127.0.0.1:6379> spop k2
(nil)
127.0.0.1:6379> spop k2
(nil)
127.0.0.1:6379> spop k3 3 --> 公司年会抽奖
1) "8"
2) "6"
3) "4"
127.0.0.1:6379> spop k3 5
1) "5"
2) "7"
127.0.0.1:6379> zadd k1 8 apple 2 banana 3 orange
(integer) 3
127.0.0.1:6379> zrange k1 0 -1
1) "banana"
2) "orange"
3) "apple"
127.0.0.1:6379> zrange k1 0 -1 withscores
1) "banana"
2) "2"
3) "orange"
4) "3"
5) "apple"
6) "8"
127.0.0.1:6379> zrangebyscore k1 3 8
1) "orange"
2) "apple"
127.0.0.1:6379> zrange k1 0 1
1) "banana"
2) "orange"
127.0.0.1:6379> zrevrange k1 0 1
1) "apple"
2) "orange"
127.0.0.1:6379> zscore k1 apple
"8"
127.0.0.1:6379> zrank k1 apple
(integer) 2
127.0.0.1:6379> zrange k1 0 -1 withscores
1) "banana"
2) "2"
3) "orange"
4) "3"
5) "apple"
6) "8"
127.0.0.1:6379> zincrby k1 2.5 banana
"4.5"
127.0.0.1:6379> zrange k1 0 -1 withscores
1) "orange"
2) "3"
3) "banana"
4) "4.5"
5) "apple"
6) "8"
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> zadd k1 80 tom 60 peter 70 jery
(integer) 3
127.0.0.1:6379> zadd k2 60 tom 100 peter 40 baby
(integer) 3
127.0.0.1:6379> zunionstore unkey 2 k1 k2
(integer) 4
127.0.0.1:6379> zrange unkey 0 -1 withscores
1) "baby"
2) "40"
3) "jery"
4) "70"
5) "tom"
6) "140"
7) "peter"
8) "160"
127.0.0.1:6379> zunionstore unkey1 2 k1 k2 weights 1 0.5
(integer) 4
127.0.0.1:6379> zrange unkey1 0 -1 withscores
1) "baby"
2) "20"
3) "jery"
4) "70"
5) "peter"
6) "110"
7) "tom"
8) "110"
127.0.0.1:6379> zunionstore unkey2 2 k1 k2 aggregate max
(integer) 4
127.0.0.1:6379> zrange unkey2 0 -1 withscores
1) "baby"
2) "40"
3) "jery"
4) "70"
5) "tom"
6) "80"
7) "peter"
8) "100"
[root@localhost ~]# nc localhost 6379
keys *
*0
set k1 hello
+OK
get k1
$5
hello
^C
[root@localhost ~]# echo -e "test\nhello"
test
hello
[root@localhost ~]# echo -e "set k2 99\nincr k2\nget k2" | nc localhost 6379
+OK
:100
$3
100
127.0.0.1:6379> help @pubsub
PSUBSCRIBE pattern [pattern ...]
summary: Listen for messages published to channels matching the given patterns
since: 2.0.0
PUBLISH channel message
summary: Post a message to a channel
since: 2.0.0
PUBSUB subcommand [argument [argument ...]]
summary: Inspect the state of the Pub/Sub subsystem
since: 2.8.0
PUNSUBSCRIBE [pattern [pattern ...]]
summary: Stop listening for messages posted to channels matching the given patterns
since: 2.0.0
SUBSCRIBE channel [channel ...]
summary: Listen for messages published to the given channels
since: 2.0.0
UNSUBSCRIBE [channel [channel ...]]
summary: Stop listening for messages posted to the given channels
since: 2.0.0
127.0.0.1:6379> publish ooxx hello
(integer) 0
127.0.0.1:6379> publish ooxx hellobaby
(integer) 1
127.0.0.1:6379> publish ooxx hellojingjing
(integer) 2
127.0.0.1:6379> subscribe ooxx
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "ooxx"
3) (integer) 1
1) "message"
2) "ooxx"
3) "hellobaby"
1) "message"
2) "ooxx"
3) "hellojingjing"
127.0.0.1:6379> subscribe ooxx
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "ooxx"
3) (integer) 1
1) "message"
2) "ooxx"
3) "hellojingjing"
127.0.0.1:6379> help @transactions
DISCARD -
summary: Discard all commands issued after MULTI
since: 2.0.0
EXEC -
summary: Execute all commands issued after MULTI
since: 1.2.0
MULTI -
summary: Mark the start of a transaction block
since: 1.2.0
UNWATCH -
summary: Forget about all watched keys
since: 2.2.0
WATCH key [key ...]
summary: Watch the given keys to determine execution of the MULTI/EXEC block
since: 2.2.0
127.0.0.1:6379> multi
OK
127.0.0.1:6379> set k1 88
QUEUED
127.0.0.1:6379> set k2 99
QUEUED
127.0.0.1:6379> exec
1) OK
2) OK
[root@localhost ~]# redis-cli
127.0.0.1:6379> multi
OK
127.0.0.1:6379> get k1
QUEUED
127.0.0.1:6379> exec
1) (nil)
[root@localhost ~]# redis-cli
127.0.0.1:6379> multi
OK
127.0.0.1:6379> del k1
QUEUED
127.0.0.1:6379> exec
127.0.0.1:6379> watch k1
OK
127.0.0.1:6379> multi
OK
127.0.0.1:6379> get k1
QUEUED
127.0.0.1:6379> keys *
QUEUED
127.0.0.1:6379> exec
(nil)
127.0.0.1:6379> set k1 erwerer
OK
[root@localhost soft]# wget https://github.com/RedisBloom/RedisBloom/archive/refs/tags/v2.2.17.zip
[root@localhost soft]# yum install -y unzip
[root@localhost soft]# unzip RedisBloom-2.2.17.zip
Archive: RedisBloom-2.2.17.zip
[root@localhost soft]# ll
total 2424
drwxrwxr-x. 6 root root 4096 Jun 5 04:51 redis-5.0.5
-rw-r--r--. 1 root root 1975750 Jun 27 2020 redis-5.0.5.tar.gz
drwxr-xr-x. 12 root root 4096 Jun 8 07:53 RedisBloom-2.2.17
-rw-r--r--. 1 root root 126348 Jun 9 13:26 RedisBloom-2.2.17.zip
[root@localhost soft]# cd RedisBloom-2.2.17
[root@localhost RedisBloom-2.2.17]# make
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/src/rebloom.o /soft/RedisBloom-2.2.17/src/rebloom.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/contrib/MurmurHash2.o /soft/RedisBloom-2.2.17/contrib/MurmurHash2.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/rmutil/util.o /soft/RedisBloom-2.2.17/rmutil/util.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/src/sb.o /soft/RedisBloom-2.2.17/src/sb.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/src/cf.o /soft/RedisBloom-2.2.17/src/cf.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/src/rm_topk.o /soft/RedisBloom-2.2.17/src/rm_topk.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/src/topk.o /soft/RedisBloom-2.2.17/src/topk.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/src/rm_cms.o /soft/RedisBloom-2.2.17/src/rm_cms.c
cc -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -fcommon -I/soft/RedisBloom-2.2.17 -I/soft/RedisBloom-2.2.17/contrib -c -o /soft/RedisBloom-2.2.17/src/cms.o /soft/RedisBloom-2.2.17/src/cms.c
cc /soft/RedisBloom-2.2.17/src/rebloom.o /soft/RedisBloom-2.2.17/contrib/MurmurHash2.o /soft/RedisBloom-2.2.17/rmutil/util.o /soft/RedisBloom-2.2.17/src/sb.o /soft/RedisBloom-2.2.17/src/cf.o /soft/RedisBloom-2.2.17/src/rm_topk.o /soft/RedisBloom-2.2.17/src/topk.o /soft/RedisBloom-2.2.17/src/rm_cms.o /soft/RedisBloom-2.2.17/src/cms.o -o /soft/RedisBloom-2.2.17/redisbloom.so -shared -Wl,-Bsymbolic,-Bsymbolic-functions -lm -lc
[root@localhost RedisBloom-2.2.17]# ll
total 388
drwxr-xr-x. 3 root root 20 Jun 8 07:53 build
-rw-r--r--. 1 root root 211 Jun 8 07:53 changelog
-rw-r--r--. 1 root root 520 Jun 8 07:53 codecov.yml
drwxr-xr-x. 2 root root 99 Jun 9 13:28 contrib
drwxr-xr-x. 3 root root 21 Jun 8 07:53 deps
-rw-r--r--. 1 root root 431 Jun 8 07:53 Dockerfile
drwxr-xr-x. 3 root root 247 Jun 8 07:53 docs
-rwxr-xr-x. 1 root root 715 Jun 8 07:53 getver
-rw-r--r--. 1 root root 5789 Jun 8 07:53 LICENSE
-rw-r--r--. 1 root root 3948 Jun 8 07:53 Makefile
-rw-r--r--. 1 root root 1464 Jun 8 07:53 mkdocs.yml
drwxr-xr-x. 3 root root 19 Jun 8 07:53 opt
-rwxr-xr-x. 1 root root 5767 Jun 8 07:53 pack.sh
-rw-r--r--. 1 root root 570 Jun 8 07:53 ramp.yml
-rw-r--r--. 1 root root 4640 Jun 8 07:53 README.md
-rwxr-xr-x. 1 root root 331632 Jun 9 13:28 redisbloom.so
drwxr-xr-x. 2 root root 48 Jun 9 13:28 rmutil
drwxr-xr-x. 2 root root 4096 Jun 9 13:28 src
-rwxr-xr-x. 1 root root 1825 Jun 8 07:53 system-setup.py
drwxr-xr-x. 4 root root 4096 Jun 8 07:53 tests
[root@localhost redis5]# redis-server --loadmodule /opt/soft/redis5/redisbloom.so
1231:C 09 Jun 2022 13:59:45.108 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1231:C 09 Jun 2022 13:59:45.108 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1231, just started
1231:C 09 Jun 2022 13:59:45.108 # Configuration loaded
1231:M 09 Jun 2022 13:59:45.108 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.5 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 1231
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
1231:M 09 Jun 2022 13:59:45.109 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1231:M 09 Jun 2022 13:59:45.109 # Server initialized
1231:M 09 Jun 2022 13:59:45.109 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1231:M 09 Jun 2022 13:59:45.109 * Module 'bf' loaded from /opt/soft/redis5/redisbloom.so
1231:M 09 Jun 2022 13:59:45.109 * Ready to accept connections
管道 :衔接前一个命令的输出作为后一个命令的输入
管道:会触发创建【子进程】
$$ 高于 |
使用linux的时候:父子进程
父进程的数据,子进程可不可以看得到?
常规思想,进程之间数据是要隔离的
进阶思想,父进程其实可以让子进程看到数据!
linux中 export的环境变量,子进程的修改不会破坏父进程
父进程的修改也不会破坏子进程
[root@localhost ~]# ls -l /etc
total 1064
[root@localhost ~]# ls -l /etc | more
total 1064
-rw-r--r--. 1 root root 5090 Aug 6 2019 DIR_COLORS
drwxr-xr-x. 2 root root 220 Apr 2 2020 yum.repos.d
[root@localhost ~]# num=0
[root@localhost ~]# echo $num
0
[root@localhost ~]# ((num++))
[root@localhost ~]# echo $num
1
[root@localhost ~]# ((num++)) | echo ok
ok
[root@localhost ~]# echo $num
1
[root@localhost ~]# echo $$
972
[root@localhost ~]# echo $$ | more
972
[root@localhost ~]# echo $BASHPID
972
[root@localhost ~]# echo $BASHPID | more
1102
[root@localhost ~]# echo $BASHPID | more
1104
[root@localhost ~]# echo $BASHPID | more
1106
[root@localhost ~]# echo $$
972
[root@localhost ~]# echo $num
1
[root@localhost ~]# /bin/bash
[root@localhost ~]# echo $$
1109
[root@localhost ~]# pstree
bash: pstree: command not found
[root@localhost ~]# pstree
systemd─┬─NetworkManager─┬─dhclient
│ └─2*[{NetworkManager}]
├─agetty
├─auditd───{auditd}
├─chronyd
├─crond
├─dbus-daemon───{dbus-daemon}
├─gssproxy───5*[{gssproxy}]
├─master─┬─pickup
│ └─qmgr
├─polkitd───6*[{polkitd}]
├─2*[redis-server───3*[{redis-server}]]
├─rpcbind
├─rsyslogd───2*[{rsyslogd}]
├─sshd─┬─sshd───sshd───bash───sudo───bash───bash───pstree
│ └─sshd───sshd───bash───sudo───bash
├─systemd-journal
├─systemd-logind
├─systemd-udevd
└─tuned───4*[{tuned}]
[root@localhost ~]# echo $num
[root@localhost ~]# exit
exit
[root@localhost ~]# pstree
systemd─┬─NetworkManager─┬─dhclient
│ └─2*[{NetworkManager}]
├─agetty
├─auditd───{auditd}
├─chronyd
├─crond
├─dbus-daemon───{dbus-daemon}
├─gssproxy───5*[{gssproxy}]
├─master─┬─pickup
│ └─qmgr
├─polkitd───6*[{polkitd}]
├─2*[redis-server───3*[{redis-server}]]
├─rpcbind
├─rsyslogd───2*[{rsyslogd}]
├─sshd─┬─sshd───sshd───bash───sudo───bash───pstree
│ └─sshd───sshd───bash───sudo───bash
├─systemd-journal
├─systemd-logind
├─systemd-udevd
└─tuned───4*[{tuned}]
[root@localhost ~]# echo $num
1
[root@localhost ~]# export num
[root@localhost ~]# echo $num
1
[root@localhost ~]# /bin/bash
[root@localhost ~]# pstree
systemd─┬─NetworkManager─┬─dhclient
│ └─2*[{NetworkManager}]
├─agetty
├─auditd───{auditd}
├─chronyd
├─crond
├─dbus-daemon───{dbus-daemon}
├─gssproxy───5*[{gssproxy}]
├─master─┬─pickup
│ └─qmgr
├─polkitd───6*[{polkitd}]
├─2*[redis-server───3*[{redis-server}]]
├─rpcbind
├─rsyslogd───2*[{rsyslogd}]
├─sshd─┬─sshd───sshd───bash───sudo───bash───bash───pstree
│ └─sshd───sshd───bash───sudo───bash
├─systemd-journal
├─systemd-logind
├─systemd-udevd
└─tuned───4*[{tuned}]
[root@localhost ~]# echo $num
1
[root@localhost ~]# vi test.sh
[root@localhost ~]# chmod +x test.sh
[root@localhost ~]# ll
total 20
-rw-------. 1 root root 5570 Apr 30 2020 anaconda-ks.cfg
-rw-------. 1 root root 5300 Apr 30 2020 original-ks.cfg
-rwxr-xr-x. 1 root root 73 Jun 11 04:15 test.sh
[root@localhost ~]# ./test.sh &
[1] 1148
[root@localhost ~]# 1148
1
num:999
999
[1]+ Done ./test.sh
[root@localhost ~]# echo $$
1131
[root@localhost ~]# echo $num
1
[root@localhost ~]# ./test.sh &
[1] 1150
[root@localhost ~]# 1150
1
num:999
^C
[root@localhost ~]# echo $num
1
[root@localhost ~]# 999
[1]+ Done ./test.sh
[root@localhost ~]#
[root@localhost ~]# man fork
fork() is implemented using copy-on-write pages
[root@localhost ~]# cd /var/lib/redis/6379
[root@localhost 6379]# ll
total 4
-rw-r--r--. 1 root root 92 Jun 11 08:31 dump.rdb
[root@localhost 6379]# rm -rf ./*
[root@localhost 6379]# ll
total 0
[root@localhost 6379]# ll
total 0
-rw-r--r--. 1 root root 0 Jun 11 08:41 appendonly.aof
[root@localhost 6379]# cat appendonly.aof
[vagrant@localhost ~]$ sudo -i
[root@localhost ~]# redis-cli
127.0.0.1:6379> set k1 hello
OK
127.0.0.1:6379> set k2 cjj
OK
127.0.0.1:6379> bgsave
Background saving started
127.0.0.1:6379> set k1 a
OK
127.0.0.1:6379> set k2 b
OK
127.0.0.1:6379> set k3 c
OK
127.0.0.1:6379> get k3
"c"
127.0.0.1:6379> BGREWRITEAOF
Background append only file rewriting started
127.0.0.1:6379> exit