MacOS 및 Linux 문제 해결 단계
MacOS 및 Linux 문제 해결 단계
다음 단계를 수행하면 프록시가 있는지 확인하고, 추가 문제 해결에 필요한 프록시 호스트와 포트 번호를 수집할 수 있어요.
참고 다음 단계는 Snowflake의 연결 문제 해결 도구를 사용해 테스트를 수행할 수 없다고 판단한 경우에만 적용돼요.
본문
새 Terminal 창을 열고, 네트워크에 특정한 프록시 구성 세부 정보를 가져오기 위해 다음 명령을 실행해요. 테스트하려는 실제 호스트 이름으로 example.com을 바꾸세요.
networksetup -getsecurewebproxy "$(networksetup -listnetworkserviceorder | grep $(route get example.com | grep interface | awk -F: '{print $2}') | awk -FPort: '{print $2}' | awk -F, '{print $1}' | sed 's/^ //g')"
프록시 구성이 있을 때의 출력 예시:
Enabled: Yes
Server: 192.168.21.12
Port: 3128
Authenticated Proxy Enabled: 1
프록시 구성이 없을 때의 출력 예시:
Enabled: No
Server:
Port: 0
Authenticated Proxy Enabled: 0
또한 프록시 설정에 사용되는 일반적인 환경 변수를 다음 명령으로 테스트할 수 있어요.
env | grep -i proxy
이 명령은 다음과 유사한 출력을 반환해요.
http_proxy=http://my.pro.xy:123
HTTP_PROXY=http://my.pro.xy:123
HTTPS_PROXY=http://my.pro.xy:123
https_proxy=http://my.pro.xy:123
NO_PROXY=localhost,.example.com,.amazonaws.com
- 프록시 발견: 이러한 환경 변수 설정을 기반으로 추가 테스트에 필요한 프록시 호스트와 포트를 수집할 수 있어요.
- 프록시 없음: 출력이 비어 있다면 프록시 구성에 대한 환경 변수가 설정되지 않은 것이며, 추가 테스트가 필요해요.
NO_PROXY는 클라이언트가 프록시 서버를 거치지 않고 직접 연결할 수 있는 호스트를 정의해요.
프록시가 있는 경우
연결 문제를 겪고 있는 특정 URL을 식별할 수 있어요. Snowflake 허용 목록에 나열된 모든 URL을 테스트하는 것이 좋지만, 설정에서 직접 문제를 일으키는 URL에 집중할 수도 있어요.
export http_proxy=http://<PROXY_HOST:PROXY_PORT> && export HTTP_PROXY=$http_proxy && export HTTPS_PROXY=$http_proxy && export https_proxy=$http_proxy
curl -v https://URL 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
또는 환경 변수를 먼저 설정하지 않고 프록시 설정을 curl에 직접 전달할 수도 있어요.
인증 없는 프록시:
curl --proxy "<PROTOCOL>://<HOST>:<PORT>" ..rest of the arguments..
인증이 있는 프록시:
curl --proxy "<PROTOCOL>://<HOST>:<PORT>" --proxy-user user:pass ..rest of the arguments..
Terminal에서 다음 명령을 실행해요. 문제를 일으키는 URL로 명령을 업데이트하고, <URL>을 문제가 있는 URL로 바꾸세요. 또한 <PROXY_URL>을 프록시 정보로 바꾸세요.
export http_proxy=http://<PROXY_URL> && export HTTP_PROXY=$http_proxy && export HTTPS_PROXY=$http_proxy && export https_proxy=$http_proxy
curl -v https://<URL> 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
이 명령은 HTTP 및 HTTPS 요청에 프록시를 사용하도록 환경을 구성하고, 지정된 Snowflake URL에 연결을 시도해요. 또한 성공적인 연결이나 발생한 오류를 포함해 연결 시도에 대한 자세한 정보를 출력해요.
성공적인 연결 출력 예시:
➜ curl -v https://<account>.snowflakecomputing.com 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Trying <IP ADDRESS>...
* Connected to <IP ADDRESS> (<IP ADDRESS>) port <PORT> (#0)
* Establish HTTP proxy tunnel to <account>.snowflakecomputing.com:443
연결 실패 예시:
➜ curl -v https://<account>.snowflakecomputing.com 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Trying 52.22.29.117:443...
* Connected to <account>.snowflakecomputing.com (52.22.29.117) port 443 (#0)
curl: (7) Failed to connect to <account>.snowflakecomputing.com port 443 after 3139 ms: Connection refused
프록시가 없는 경우
Terminal에서 다음 명령을 실행하되, 명령의 URL을 테스트하는 Snowflake URL에 맞게 업데이트해야 해요.
curl -v https://<URL> 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
성공적인 연결 출력 예시:
➜ curl -v https://<account>.snowflakecomputing.com 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Trying 52.22.29.117:443...
* Connected to <account>.snowflakecomputing.com (52.22.29.117) port 443 (#0)
* subject: CN=*.us-east-1.snowflakecomputing.com
* subjectAltName: host "<account>.snowflakecomputing.com" matched cert's "*.us-east-1.snowflakecomputing.com"
* issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
> GET / HTTP/1.1
< HTTP/1.1 302 Found
이 출력은 성공적인 연결을 보여 주며, 시스템이 Snowflake 서버에 도달해 통신할 수 있음을 나타내요.
연결 실패 예시:
➜ curl -v https://<account>.snowflakecomputing.com 2>&1 | tee | grep "Trying\|Connected\|Establish\|CONNECT\|subject\|issuer\|HTTP\|curl"
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Trying 52.22.29.117:443...
* Trying 3.222.247.13:443...
* Trying 54.81.51.170:443...
curl: (7) Failed to connect to <account>.us-east-1.snowflakecomputing.com port 443 after 3139 ms: Connection refused
이 단계를 완료한 후에는 후속 조치로 계속 진행해요.