찾다
데이터 베이스RedisRedis를 원격으로 액세스할 수 있게 만드는 방법

Redis를 원격으로 액세스할 수 있게 만드는 방법

소개:

redis는 기본적으로 로컬 액세스만 허용한다는 것을 모두 알고 있습니다. 그렇다면 redis에 대한 원격 액세스를 활성화하려면 어떻게 해야 할까요?

특정 방법:

NETWORK 섹션에 설명된 대로 redis.conf 파일을 엽니다

################################## NETWORK #####################################
 
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1

해결책: 모든 IP가 redis에 액세스할 수 있도록 바인드 127.0.0.1을 주석 처리합니다.

액세스를 위해 여러 IP를 지정하고 싶지만 전부는 아닙니다. IP에 접근하려면 바인딩하면 됩니다

Note

아래에 설명이 있습니다

# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
#
# When protected mode is on and if:
#
# 1) The server is not binding explicitly to a set of addresses using the
#    "bind" directive.
# 2) No password is configured.
#
# The server only accepts connections from clients connecting from the
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
# sockets.
#
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
protected-mode yes

redis3.2 이후 redis는 보호 모드를 추가했습니다. 이 모드에서는 바인딩 127.0.0.1을 주석 처리해도 됩니다. redisd에 다시 액세스하세요. 여전히 다음과 같은 오류가 보고됩니다.

(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

관련 권장 사항: redis 데이터베이스 튜토리얼

위 내용은 Redis를 원격으로 액세스할 수 있게 만드는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
이 기사는 博客园에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제
Redis 버전 번호를 보는 방법Redis 버전 번호를 보는 방법Apr 10, 2025 pm 04:09 PM

redis에서 버전 번호를 보는 두 가지 방법이 있습니다. 1. "redis -cli -v"명령을 사용하여 버전 번호를 직접 출력하십시오. 2. "redis-cli info server"명령을 사용하여 버전 번호를 포함하여보다 자세한 정보를 출력하십시오.

Redis 버전 번호보기 명령 세부 사항Redis 버전 번호보기 명령 세부 사항Apr 10, 2025 pm 04:06 PM

Redis 버전 번호를 볼 수있는 명령은 다음과 같습니다. Info Info Serverecho Echo Echo 버전 클리어 목록 및 Connected_Since 값을 계산합니다 (Redis 서버 실행에만 적용 가능)

명령 줄을 통해 Redis 버전을 봅니다명령 줄을 통해 Redis 버전을 봅니다Apr 10, 2025 pm 04:03 PM

Redis 버전을 보는 방법? 단계는 다음과 같습니다. redis 클라이언트를 시작하고 redis_version 필드를 찾기 위해 정보 명령을 실행하고 그 값은 redis 버전 번호입니다.

Redis 버전 번호 비교Redis 버전 번호 비교Apr 10, 2025 pm 04:00 PM

Redis 버전 번호를 보는 방법에는 다음이 포함됩니다. 명령 줄 도구 사용 Redis-Cli, Redis Info 명령, Redis Manager 및 환경 변수 사용. REDIS-CLI-Version은 로컬 및 원격 인스턴스에 적합한 반면 Redis-Cli Info | grep redis_version은 더 많은 정보를 제공하지만 로컬 인스턴스에만 제공합니다. Redis Manager는 그래픽 인터페이스를 제공하지만 타사 도구가 필요합니다. 환경 변수 echo $ redis_version은 docker와 같은 특정 환경에서 유용합니다.

Redis 버전 번호를 알아야하는 이유Redis 버전 번호를 알아야하는 이유Apr 10, 2025 pm 03:57 PM

Redis 버전 번호를 이해하는 것은 호환성, 보안, 성능 최적화, 버그 수정 및 문서와 관련이 있기 때문에 중요합니다. 응용 프로그램이 Redis 버전과 호환되는지 확인하십시오. 보안 취약점을 식별하고 해결합니다. 애플리케이션 성능을 최적화하고 새로운 최적화를 활용하십시오. 애플리케이션 안정성을 향상시키기 위해 버그 수정을 얻으십시오. 특정 버전의 정보 및 지원 리소스에 액세스하십시오.

Redis 버전 호환성 문제Redis 버전 호환성 문제Apr 10, 2025 pm 03:54 PM

Redis 버전 호환성은 다른 버전간에 통신하는 능력을 나타냅니다. 호환성은 다음 수준으로 나뉩니다. 뒤로 호환성 : 새 서버는 이전 클라이언트 명령을 처리 할 수 ​​있습니다. 상향 호환성 : 이전 클라이언트는 새로운 서버에 연결할 수 있지만 새로운 기능을 사용할 수는 없습니다. 완전히 호환 가능 : 다른 버전의 무제한 상호 작용. 호환성은 프로토콜 변경, 데이터 구조 변경 및 새로운 기능에 의해 영향을받습니다. 통합 버전, 테스트 및 호환 라이브러리를 사용하여 호환성 문제를 피할 수 있습니다.

Redis에서 모든 키를 보는 방법Redis에서 모든 키를 보는 방법Apr 10, 2025 pm 03:51 PM

Redis에서 모든 키를 보는 방법은 다음과 같습니다. 키 이름을 키즈 명령과 일치시키는 방법; 스캔 명령으로 모든 키를 반복합니다. 덤프 및 복원 명령으로 핵심 값을 덤프 및 복원; redisinsight 도구를 사용하여 키를 탐색합니다. Redis 클러스터에 대한 클러스터 키 슬롯 및 클러스터 GetKeysInslot 명령 사용; LUA 스크립트를 사용하여 모든 키가 포함 된 테이블을 생성합니다.

Redis는 모든 주요 명령을 봅니다Redis는 모든 주요 명령을 봅니다Apr 10, 2025 pm 03:48 PM

Redis의 키 명령은 모든 키를 보는 데 사용될 수 있습니다. 명령 구문 : 키 패턴 명령 매개 변수 : 패턴 * (임의 문자) 및와 같은 키를 검색 할 때 사용할 수있는 와일드 카드 패턴을 지정합니다. (단일 문자). 결과 : 패턴과 일치하는 모든 키 목록을 반환합니다. 예 : 키 *는 모든 키를 반환합니다. 팁 : 빈 모드 "*"를 사용하여 모든 키를 보거나 변수 길이 와일드 카드를 사용할 수 있습니다. ":"여러 문자와 일치합니다. 복잡성 : O (n), 여기서 n은 데이터베이스의 키 수입니다.

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

SecList

SecList

SecLists는 최고의 보안 테스터의 동반자입니다. 보안 평가 시 자주 사용되는 다양한 유형의 목록을 한 곳에 모아 놓은 것입니다. SecLists는 보안 테스터에게 필요할 수 있는 모든 목록을 편리하게 제공하여 보안 테스트를 더욱 효율적이고 생산적으로 만드는 데 도움이 됩니다. 목록 유형에는 사용자 이름, 비밀번호, URL, 퍼징 페이로드, 민감한 데이터 패턴, 웹 셸 등이 포함됩니다. 테스터는 이 저장소를 새로운 테스트 시스템으로 간단히 가져올 수 있으며 필요한 모든 유형의 목록에 액세스할 수 있습니다.

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

Atom Editor Mac 버전 다운로드

Atom Editor Mac 버전 다운로드

가장 인기 있는 오픈 소스 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.