k8s(190)
-
java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "charSequence" is null
null 처리 필요 // Normalize to plain String for STRING fields if (field.schema().getType() == Schema.Type.STRING) { fieldValue = fieldValue != null ? fieldValue.toString() : ""; }
2025.03.14 -
org.apache.avro.SchemaParseException: Illegal character in: x-forwarded-for
In Avro schema field names, you cannot use hyphens (-) or special characters.
2025.03.14 -
Avro 설정
pom.xml io.confluent kafka-avro-serializer 7.5.1 org.apache.avro avro 1.11.1 confluent https://packages.confluent.io/maven/ application.ymlspring: kafka: bootstrap-servers: {접속정보} # Non-Avro Kafka Producer producer: key-serializer: org.apache.kafka.common.serialization.StringSerializer value-serializer: ..
2025.03.14 -
LoadBalancer IP 지정
loadBalancerIP 없이 적용하면, 임의로 IP가 할당됨그 IP를 명시적으로 기술하면 됨apiVersion: v1kind: Servicemetadata: name: my-servicespec: type: LoadBalancer loadBalancerIP: 192.168.1.244 selector: app: my-app ports: - protocol: TCP port: 80 targetPort: 8080
2025.03.14 -
Broker 외부에 노출하기
Service: node별로 생성apiVersion: v1kind: Servicemetadata: name: kafka-0-svc namespace: kafkaspec: type: LoadBalancer ports: - port: 9092 # Kafka default port targetPort: 9092 selector: statefulset.kubernetes.io/pod-name: kafka-0ConfigMapapiVersion: v1kind: ConfigMapmetadata: name: kafka-external-config namespace: kafkadata: kafka-0: "PLAINTEXT://{LoadBalancer1 IP}:9092" kafka-1:..
2025.03.10 -
imagePullPolicy: Always or IfNotPresent
IfNotPresent: 이미지가 local에 있으면, tag가 변경되지 않으면, 이미지를 pull하지 않음Always: tag에 상관없이 무조건 이미지를 pull함 containers: - name: kafka-producer image: test/kafka:0.0002 imagePullPolicy: Always #IfNotPresent
2025.03.09