이 페이지에서는 Apache Spark용 Dataproc Serverless 일괄 워크로드 및 대화형 세션의 일반적인 네트워크 연결 문제를 진단하고 해결하는 방법을 안내합니다.
이러한 문제로 인해 워크로드가 필수 데이터 소스, 외부 서비스 또는 Google Cloud API에 액세스하지 못할 수 있습니다.
일반적인 증상 및 오류 메시지
Apache Spark용 서버리스에서 연결 문제가 발생하면 다음과 같은 오류가 발생할 수 있습니다.
Unable to connect to service_name.googleapis.com
Could not reach required Google APIs
Connection refused
Host unreachable
Operation timed out
Permission denied (API 호출을 차단하는 경우 네트워크와 관련이 있는 경우가 많음)
Cloud Storage, BigQuery 또는 기타 데이터베이스에서 데이터에 액세스하는 것과 관련된 오류가 발생할 수도 있습니다.
일반적인 원인 및 문제 해결 도움말
이 섹션에서는 Apache Spark용 서버리스 연결 문제의 일반적인 원인을 나열하고 문제를 해결하는 데 도움이 되는 문제 해결 팁을 제공합니다.
네트워크 구성
네트워크 잘못된 구성은 연결 실패의 빈번한 원인입니다.
Apache Spark용 서버리스 워크로드 및 세션은 내부 IP 주소가 있는 VM에서 실행되며, Google API 및 서비스에 액세스하기 위해 워크로드 또는 세션 서브넷에서 비공개 Google 액세스 (PGA)가 자동으로 사용 설정됩니다. 자세한 내용은 Apache Spark용 서버리스 네트워크 구성을 참고하세요.
액세스 옵션:
Private Service Connect (PSC): VPC 네트워크 내에서 비공개 엔드포인트를 만들어 특정 Google API에 액세스할 수 있습니다.
Google Cloud 콘솔에서 Private Service Connect > 엔드포인트로 이동합니다.
엔드포인트를 연결하거나 storage.googleapis.com, dataproc.googleapis.com과 같은 필수 API의 엔드포인트가 연결되어 있고 일괄 워크로드 또는 세션 가상 프라이빗 클라우드 네트워크에 연결되어 있는지 확인합니다.
Cloud NAT: 워크로드에서 공개 인터넷에 액세스해야 하는 경우 일괄 워크로드 또는 세션 서브넷에 대해 Cloud NAT를 구성할 수 있습니다.
Google Cloud 콘솔에서 Cloud NAT 페이지로 이동합니다.
게이트웨이를 구성하거나 일괄 워크로드 또는 세션 VPC 네트워크, 리전, 서브넷에 대해 게이트웨이가 구성되어 있는지 확인합니다. 또한 방화벽 규칙이 0.0.0.0/0로의 이그레스를 허용하는지 확인합니다. 자세한 내용은 Cloud NAT 설정을 참고하세요.
방화벽 규칙의 특성은 다음과 같습니다.
VPC 네트워크 (또는 해당하는 경우 공유 VPC 네트워크 호스트 프로젝트)의 이그레스 방화벽 규칙이 필수 대상에 대한 아웃바운드 트래픽을 차단해서는 안 됩니다.
해당하는 경우 송신 규칙은 Google Cloud외부의 공개 API 및 데이터베이스와 같은 외부 서비스로의 트래픽을 허용해야 합니다.
일괄 워크로드 또는 세션에 인터넷 액세스가 필요한 경우 Cloud NAT를 사용하여 서브넷 이그레스를 제공할 수 있습니다.
연결 문제의 일반적인 원인은 아니지만 인그레스 규칙이 너무 제한적이면 필요한 반환 트래픽이나 내부 통신이 실수로 차단될 수 있습니다.
DNS 확인:
DNS 변환은 VPC 네트워크 내에서 구성해야 합니다. 워크로드와 세션은 storage.googleapis.com 또는 bigquery.googleapis.com과 같은 Google API와 외부 서비스의 호스트 이름을 확인할 수 있어야 합니다.
커스텀 DNS 서버와 Cloud DNS 비공개 영역은 Google 도메인의 쿼리를 전달하거나 확인해야 합니다.
Google API에 비공개로 액세스하기 위해 Private Service Connect를 사용하는 경우 Google 서비스의 DNS 레코드는 PSC 엔드포인트를 사용하여 VPC 네트워크 내의 비공개 IP 주소로 확인되어야 합니다.
문제 해결 팁:
네트워크 및 서브넷 구성을 확인합니다.
Apache Spark용 서버리스 일괄 또는 세션 세부정보에서 networkUri 및 subnetUri를 검토합니다.
Google Cloud 콘솔에서 VPC 네트워크 및 서브넷의 설정을 검토합니다.
프록시 VM에서 연결을 테스트합니다.
일괄 또는 세션 서비스 계정을 사용하여 일괄 또는 세션 서브넷에서 테스트 Compute Engine VM을 실행합니다.
테스트 VM에서 다음 연결 테스트를 실행합니다.
nslookup storage.googleapis.com를 사용하여 DNS 변환을 확인합니다.
bigquery.googleapis.com 및 dataproc.googleapis.com과 같은 다른 Google API 도메인을 조회합니다. Apache Spark용 서버리스 서브넷에서 자동으로 사용 설정되는 비공개 Google 액세스 또는 Private Service Connect를 사용하는 경우 도메인이 비공개 IP 주소로 변환되어야 합니다.
curl -v https://storage.googleapis.com를 사용하여 Google API에 대한 HTTPS 연결을 확인합니다. 다른 Google 서비스에 연결해 봅니다.
ping 8.8.8.8를 사용하여 배치 또는 세션에 필요한 경우 인터넷 연결을 테스트합니다. Cloud NAT가 예상되는 경우 curl -v https://example.com를 시도하세요.
Apache Spark용 서버리스 워크로드 또는 세션의 로깅을 검토합니다. 네트워크 타임아웃, 연결 거부 또는 API 호출 실패와 관련된 ERROR 또는 WARNING 메시지를 찾습니다. Spark 관련 네트워크 문제에 대해 jsonPayload.component="driver" 또는 jsonPayload.component="executor"로 필터링합니다.
IAM 권한
IAM 권한이 부족하면 워크로드나 세션이 리소스에 액세스할 수 없게 되어 API 호출이 거부될 경우 네트워크 오류가 발생할 수 있습니다.
일괄 워크로드 또는 세션에서 사용하는 서비스 계정에 필요한 역할이 있어야 합니다.
Dataproc 작업자 역할 (roles/dataproc.worker)
데이터 액세스 역할(예: roles/storage.objectViewer 또는 roles/bigquery.dataViewer)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Troubleshoot batch and session connectivity\n\nThis page provides guidance on diagnosing and resolving common network\nconnectivity issues for Serverless for Apache Spark batch workloads and interactive sessions.\nThese issues can prevent your workloads from accessing required data sources,\nexternal services, or Google Cloud APIs.\n\nCommon symptoms and error messages\n----------------------------------\n\nWhen Serverless for Apache Spark encounters connectivity problems, you might\nencounter errors such as:\n\n- `Unable to connect to service_name.googleapis.com`\n- `Could not reach required Google APIs`\n- `Connection refused`\n- `Host unreachable`\n- `Operation timed out`\n- `Permission denied` (often network-related if blocking API calls)\n\nYou might also encounter errors related to accessing data in Cloud Storage,\nBigQuery, or other databases.\n\nCommon causes and troubleshooting tips\n--------------------------------------\n\nThis section lists common causes of Serverless for Apache Spark\nconnectivity issues, and provides troubleshooting tips to help you resolve them.\n\n### Network configuration\n\nNetwork misconfigurations are a frequent cause of connectivity failures.\nServerless for Apache Spark workloads and sessions run on VMs with internal\nIP addresses, with [Private Google Access (PGA)](/vpc/docs/configure-private-google-access)\nautomatically enabled on the workload or session subnet to access\nto Google APIs and services. For more information, see\n[Serverless for Apache Spark network configuration](/dataproc-serverless/docs/concepts/network).\n\n- Access options:\n\n - Private Service Connect (PSC): You can\n [create private endpoints](/vpc/docs/about-accessing-google-apis-endpoints)\n within your VPC network to access specific Google APIs.\n\n - In the Google Cloud console, go to [**Private Service Connect \\\u003e Endpoints**](https://console.cloud.google.com/net-services/psc/list/consumers). Connect endpoints or confirm that endpoints are connected for all required APIs, such as `storage.googleapis.com` and `dataproc.googleapis.com` and that they connect to the batch workload or session Virtual Private Cloud network.\n - Cloud NAT: If your workload needs to access the public\n internet, you can configure Cloud NAT for\n your batch workload or session subnet:\n\n - In the Google Cloud console, go to the [**Cloud NAT**](https://console.cloud.google.com/net-services/nat/list) page. [Configure a gateway](/nat/docs/gce-example) or confirm that a gateway is configured for the batch workload or session VPC network, region, and subnet. Also make sure firewall rules allow egress to `0.0.0.0/0`. For more information, see [Set up Cloud NAT](/nat/docs/gce-example).\n- Firewall rules:\n\n - Egress firewall rules in your VPC network (or shared VPC network host project, if applicable) must not block outbound traffic to required destinations.\n - If applicable, egress rules must allow traffic to external services, such as public APIs and databases outside of Google Cloud. If your batch workload or session needs internet access, you can use a [Cloud NAT](/nat/docs/overview) to provide subnet egress.\n - Although not a common cause of connectivity issues, overly restrictive ingress rules might inadvertently block necessary return traffic or internal communications.\n- DNS resolution:\n\n - DNS resolution must be configured within the VPC network. Workloads and sessions must be able to resolve hostnames for Google APIs, such as `storage.googleapis.com` or`bigquery.googleapis.com` and external services.\n - Custom DNS servers and Cloud DNS private zones must forward or resolve queries for Google domains.\n - If you are using Private Service Connect for private access to Google APIs, DNS records for Google services must resolve to private IP addresses within your VPC network using the PSC endpoint.\n\nTroubleshooting tips:\n\n- Identify network and subnet configuration:\n\n - From Serverless for Apache Spark batch or session details, review the `networkUri` and `subnetUri`.\n - In the Google Cloud console, review the settings for the VPC network and subnet.\n- Test connectivity from a Proxy VM:\n\n - Launch a test Compute Engine VM in the batch or session subnet using the batch or session service account.\n - From the test VM, perform the following connectivity tests:\n - `nslookup storage.googleapis.com` to verify DNS resolution. Lookup other Google API domains, such as `bigquery.googleapis.com`and `dataproc.googleapis.com`. With Private Google Access, which is automatically enabled on Serverless for Apache Spark subnets, or Private Service Connect, the domains must resolve to private IP addresses.\n - `curl -v https://storage.googleapis.com` to verify HTTPS connectivity to Google APIs. Also try connecting to other Google services.\n - `ping 8.8.8.8` to test internet connectivity if required by your batch or session. Try `curl -v https://example.com` if Cloud NAT is expected.\n - Run Google Cloud [Network Intelligence Center connectivity tests](/network-intelligence-center/docs/connectivity-tests/concepts/overview) to diagnose network paths from your subnet to relevant endpoints, such as Google APIs and external IP addresses.\n- Review Cloud Logging for network errors:\n\n - Review Logging for your Serverless for Apache Spark workload or session. Look for `ERROR` or `WARNING` messages related to network timeouts, connection refusals, or API call failures. Filter by `jsonPayload.component=\"driver\"` or `jsonPayload.component=\"executor\"` for Spark-specific network issues.\n\n### IAM permissions\n\nInsufficient IAM permissions can prevent workloads or sessions from\naccessing resources, resulting in network failures if API calls are denied.\n\nThe service account used by your batch workload or session must have required\nroles:\n\n- **Dataproc Worker role** (`roles/dataproc.worker`).\n- Data access roles, such as `roles/storage.objectViewer` or `roles/bigquery.dataViewer`).\n- Logging: (`roles/logging.logWriter`).\n\nTroubleshooting tips:\n\n- Identify the batch workload or session [service account](/dataproc-serverless/docs/concepts/service-account). If not specified, it defaults to the [Compute Engine default service account](/compute/docs/access/service-accounts#default_service_account).\n- Go to the [**IAM \\& Admin \\\u003e IAM**](https://console.cloud.google.com/iam-admin/iam) page in the Google Cloud console, find the batch workload or session service account, and then verify that it has the necessary roles needed for workload operations. Grant any missing roles.\n\n### External service configuration\n\nIf your workload connects to databases or services outside of Google Cloud,\nverify their configuration:\n\n- Verify the external service firewall or security group allows inbound connections from your VPC network IP ranges: if applicable, check internal IP addresses using VPC Peering, Cloud VPN, or Cloud Interconnect, or Cloud NAT IP addresses.\n- Review database credentials or connectivity strings. Check connection details, usernames, and passwords.\n\nWhat's next\n-----------\n\n- Learn about [Serverless for Apache Spark networking](/dataproc-serverless/docs/concepts/network).\n- Review [Serverless for Apache Spark service accounts](/dataproc-serverless/docs/concepts/service-account).\n- Refer to general network troubleshooting guides:\n - [Troubleshoot Dataproc cluster creation issues](/dataproc/docs/support/troubleshoot-cluster-creation)\n - [Troubleshoot Dataproc Metastore connectivity](/dataproc-metastore/docs/troubleshooting-connectivity)"]]