설치)
apt-get install redis-server

버젼확인)
redis-server --version

재시작)
systemctl restart redis-server.service

root@sinfo:~# systemctl restart redis-server.service
root@sinfo:~# ps -ef | grep redis
redis       2778       1  0 03:53 ?        00:00:00 /usr/bin/redis-server 127.0.0.1:6379
root        2783    2101  0 03:53 pts/0    00:00:00 grep --color=auto redis
root@sinfo:~#
root@sinfo:~# netstat -an | grep 6379
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN
tcp6       0      0 ::1:6379                :::*                    LISTEN
root@sinfo:~#
root@sinfo:~# redis-cli
127.0.0.1:6379> set name1 member1
OK
127.0.0.1:6379> get name1
"member1"
127.0.0.1:6379> quit

레디스 Command 사용)
root@sinfo:~# redis-cli
127.0.0.1:6379> RPUSH name2 a b c
(integer) 3

Help>Blocking Pop, Delete Data
127.0.0.1:6379> BLPOP name2 name3 0
1) "name2"
2) "a"
127.0.0.1:6379> BLPOP name2 name3 1
1) "name2"
2) "b"
127.0.0.1:6379> BLPOP name2 name3 2
1) "name2"
2) "c"
root@sinfo:~#

방화벽오픈)
----------------------------------------------------------------------------------------------
일단 그럼 기존에 있던 방화벽을 삭제해봅시다!

dpkg -r iptables-persistent
dpkg -r netfilter-persistent
apt remove --purge iptables-persistent
----------------------------------------------------------------------------------------------
ufw enable  // 사용

ufw allow 22 // tcp,udp 둘다 허용
ufw allow 22/tcp //tcp만 허용 , udp는 뒤에 udp

ufw status // 활성 상태확인
----------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------
root@sinfo:~# ps -ef | grep redis
redis       1053       1  0 07:35 ?        00:00:00 /usr/bin/redis-server 127.0.0.1:15565
root        1656    1644  0 07:38 pts/0    00:00:00 grep --color=auto redis
root@sinfo:~# netstat -an | grep 15565
tcp        0      0 127.0.0.1:15565         0.0.0.0:*               LISTEN
tcp6       0      0 ::1:15565               :::*                    LISTEN
root@sinfo:~#
----------------------------------------------------------------------------------------------
REDIS 외부접속허용하기)
Redis설치후에, bind에 설정되어 있는 bind 127.0.0.1을 bind 0.0.0.0 으로 변경후에 재기동하면 외부에서도 접속이 가능하다.

----------------------------------------------------------------------------------------------(?????)
C:\Users\xterm>telnet 192.168.45.166 15565
연결 대상 192.168.45.166...호스트에 연결할 수 없습니다. 포트 15565: 연결하지 못했습니다.
----------------------------------------------------------------------------------------------


csc.exe /reference:ServiceStack.Common.dll,
ServiceStack.dll,
ServiceStack.Interfaces.dll,
ServiceStack.ServiceInterface.dll /out:MMM.exe /recurse:*.cs

해결을 위한 노력) 윈도우에서 설정했던,ㅡ,ㅡ환경,ㅡ들,ㅡㅡㅡㅡ

 

2023.11.11 windows

2023.11.11 ubuntu(linux)

root@sinfo:~# redis-cli
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(2023-07-18 \xec\x98\xa4\xec\xa0\x84 7:00:00),(1\xeb\xb6\x80)"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(00) today - john denver "
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(01) the girl is mine - michael jackson  paul mccartney"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(02) what a fool believes - doobie brothers"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(03) top of the world - carpenters"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(04) the power of love - huey lewis and the news"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(05) angel - sarah mclachlan "
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(06) vampire - olivia rodrigo (cbs pd\xeb\x93\xa4\xec\x9d\xb4 \xeb\xbd\x91\xec\x9d\x80 \xec\x9d\xb4 \xec\xa3\xbc\xec\x9d\x98 \xed\x8a\xb8\xeb\x9e\x99)"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(08) smile again - newton family "
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(2023-07-18 \xec\x98\xa4\xec\xa0\x84 7:00:00),(2\xeb\xb6\x80)"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(00) one love - blue"
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(01) i don't like to sleep alone - paul anka "
127.0.0.1:6379> BLPOP QCS MMMM 1
1) "QCS"
2) "(02) dust in the wind - kansas"

+ Recent posts