我正在尝试使用docker 1.13.1,kubernetes 1.9.6、1.10.1的alluxio 1.7.1

我按照https://www.alluxio.org/docs/1.7/en/Running-Alluxio-On-Docker.html上的说明创建了alluxio docker镜像

然后,我按照https://www.alluxio.org/docs/1.7/en/Running-Alluxio-On-Kubernetes.html指南在kubernetes上运行alluxio。我能够正确地启动alluxio master pod,但是当我尝试启动alluxio worker时,出现了Address在使用中的错误。我没有修改从alluxio git下载的yaml中的任何内容。我所做的唯一更改是针对Yamls中的alluxio docker镜像名称和api版本,以使k8s正确匹配。

我检查了k8s群集设置中使用的端口,甚至还检查了节点上是否正在使用。没有Alluxio希望任何其他进程使用的端口,但是我仍然收到使用中的地址错误。我无法理解我可以做些什么来进一步调试,或者我应该改变些什么才能使它正常工作。我的k8s群集设置上没有任何其他应用程序在运行。我尝试了单节点k8s群集设置和多节点k8s群集设置。我也尝试了k8s 1.9和1.10版本。

从Alluxio Worker方面肯定存在一些我无法调试的问题。

这是我从工作人员 pods 获得的日志:

[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]# kubectl logs po/alluxio-worker-knqt4
Formatting Alluxio Worker @ vm-sushil-scrum1-08062018-alluxio-1
2018-06-08 10:09:55,723 INFO  Configuration - Configuration file /opt/alluxio/conf/alluxio-site.properties loaded.
2018-06-08 10:09:55,845 INFO  Format - Formatting worker data folder: /alluxioworker/
2018-06-08 10:09:55,845 INFO  Format - Formatting Data path for tier 0:/dev/shm/alluxioworker
2018-06-08 10:09:55,856 INFO  Format - Formatting complete
2018-06-08 10:09:56,357 INFO  Configuration - Configuration file /opt/alluxio/conf/alluxio-site.properties loaded.
2018-06-08 10:09:56,549 INFO  TieredIdentityFactory - Initialized tiered identity TieredIdentity(node=10.194.11.7, rack=null)
2018-06-08 10:09:56,866 INFO  BlockWorkerFactory - Creating alluxio.worker.block.BlockWorker
2018-06-08 10:09:56,866 INFO  FileSystemWorkerFactory - Creating alluxio.worker.file.FileSystemWorker
2018-06-08 10:09:56,942 WARN  StorageTier - Failed to verify memory capacity
2018-06-08 10:09:57,082 INFO  log - Logging initialized @1160ms
2018-06-08 10:09:57,509 INFO  AlluxioWorkerProcess - Domain socket data server is enabled at /opt/domain.
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address in use
        at alluxio.worker.AlluxioWorkerProcess.<init>(AlluxioWorkerProcess.java:164)
        at alluxio.worker.WorkerProcess$Factory.create(WorkerProcess.java:45)
        at alluxio.worker.WorkerProcess$Factory.create(WorkerProcess.java:37)
        at alluxio.worker.AlluxioWorker.main(AlluxioWorker.java:56)
Caused by: java.lang.RuntimeException: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address in use
        at alluxio.util.CommonUtils.createNewClassInstance(CommonUtils.java:224)
        at alluxio.worker.DataServer$Factory.create(DataServer.java:45)
        at alluxio.worker.AlluxioWorkerProcess.<init>(AlluxioWorkerProcess.java:159)
        ... 3 more
Caused by: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address in use
        at io.netty.channel.unix.Errors.newIOException(Errors.java:117)
        at io.netty.channel.unix.Socket.bind(Socket.java:259)
        at io.netty.channel.epoll.EpollServerDomainSocketChannel.doBind(EpollServerDomainSocketChannel.java:75)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:504)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1226)
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:495)
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:480)
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:213)
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:354)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:305)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
        at java.lang.Thread.run(Thread.java:748)

-----------------------
[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]# kubectl get all
NAME                DESIRED   CURRENT   READY     UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
ds/alluxio-worker   1         1         0         1            0           <none>          42m
ds/alluxio-worker   1         1         0         1            0           <none>          42m

NAME                          DESIRED   CURRENT   AGE
statefulsets/alluxio-master   1         1         44m

NAME                      READY     STATUS    RESTARTS   AGE
po/alluxio-master-0       1/1       Running   0          44m
po/alluxio-worker-knqt4   0/1       Error     12         42m

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)               AGE
svc/alluxio-master   ClusterIP   None         <none>        19998/TCP,19999/TCP   44m
svc/kubernetes       ClusterIP   10.254.0.1   <none>        443/TCP               1h

---------------------

[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]# kubectl describe po/alluxio-worker-knqt4
Name:           alluxio-worker-knqt4
Namespace:      default
Node:           vm-sushil-scrum1-08062018-alluxio-1/10.194.11.7
Start Time:     Fri, 08 Jun 2018 10:09:05 +0000
Labels:         app=alluxio
                controller-revision-hash=3081903053
                name=alluxio-worker
                pod-template-generation=1
Annotations:    <none>
Status:         Running
IP:             10.194.11.7
Controlled By:  DaemonSet/alluxio-worker
Containers:
  alluxio-worker:
    Container ID:  docker://40a1eff2cd4dff79d9189d7cb0c4826a6b6e4871fbac65221e7cdd341240e358
    Image:         alluxio:1.7.1
    Image ID:      docker://sha256:b080715bd53efc783ee5f54e7f1c451556f93e7608e60e05b4615d32702801af
    Ports:         29998/TCP, 29999/TCP, 29996/TCP
    Command:
      /entrypoint.sh
    Args:
      worker
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Fri, 08 Jun 2018 11:01:37 +0000
      Finished:     Fri, 08 Jun 2018 11:02:02 +0000
    Ready:          False
    Restart Count:  14
    Limits:
      cpu:     1
      memory:  2G
    Requests:
      cpu:     500m
      memory:  2G
    Environment Variables from:
      alluxio-config  ConfigMap  Optional: false
    Environment:
      ALLUXIO_WORKER_HOSTNAME:   (v1:status.hostIP)
    Mounts:
      /dev/shm from alluxio-ramdisk (rw)
      /opt/domain from alluxio-domain (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-7xlz7 (ro)
Conditions:
  Type           Status
  Initialized    True
  Ready          False
  PodScheduled   True
Volumes:
  alluxio-ramdisk:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:  Memory
  alluxio-domain:
    Type:          HostPath (bare host directory volume)
    Path:          /tmp/domain
    HostPathType:  Directory
  default-token-7xlz7:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-7xlz7
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/disk-pressure:NoSchedule
                 node.kubernetes.io/memory-pressure:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute
                 node.kubernetes.io/unreachable:NoExecute
Events:
  Type     Reason                 Age                 From                                          Message
  ----     ------                 ----                ----                                          -------
  Normal   SuccessfulMountVolume  56m                 kubelet, vm-sushil-scrum1-08062018-alluxio-1  MountVolume.SetUp succeeded for volume "alluxio-domain"
  Normal   SuccessfulMountVolume  56m                 kubelet, vm-sushil-scrum1-08062018-alluxio-1  MountVolume.SetUp succeeded for volume "alluxio-ramdisk"
  Normal   SuccessfulMountVolume  56m                 kubelet, vm-sushil-scrum1-08062018-alluxio-1  MountVolume.SetUp succeeded for volume "default-token-7xlz7"
  Normal   Pulled                 53m (x5 over 56m)   kubelet, vm-sushil-scrum1-08062018-alluxio-1  Container image "alluxio:1.7.1" already present on machine
  Normal   Created                53m (x5 over 56m)   kubelet, vm-sushil-scrum1-08062018-alluxio-1  Created container
  Normal   Started                53m (x5 over 56m)   kubelet, vm-sushil-scrum1-08062018-alluxio-1  Started container
  Warning  BackOff                1m (x222 over 55m)  kubelet, vm-sushil-scrum1-08062018-alluxio-1  Back-off restarting failed container
[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]#  lsof -n -i :19999 | grep LISTEN
java    8949 root   29u  IPv4 12518521      0t0  TCP *:dnp-sec (LISTEN)
[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]#  lsof -n -i :19998 | grep LISTEN
java    8949 root   19u  IPv4 12520458      0t0  TCP *:iec-104-sec (LISTEN)
[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]#  lsof -n -i :29998 | grep LISTEN
[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]#  lsof -n -i :29999 | grep LISTEN
[root@vm-sushil-scrum1-08062018-alluxio-1 kubernetes]#  lsof -n -i :29996 | grep LISTEN

alluxio-worker容器始终重新启动,一次又一次由于相同的错误而失败。

请指导我该怎么做才能解决这个问题。

谢谢

最佳答案

问题是UNIX域套接字路径短路。我使用的是alluxio git中默认存在的内容。在默认的integration/kubernetes/conf/alluxio.properties.template中,ALLUXIO_WORKER_DATA_SERVER_DOMAIN_SOCKET_ADDRESS的地址不完整。 https://www.alluxio.org/docs/1.7/en/Running-Alluxio-On-Docker.html中对此进行了正确的说明,以允许使用unix域套接字在alluxio worker容器中进行短路读取。
仅由于缺少unix域套接字的完整路径,当为alluxio worker启用了短路读取时,alluxio worker无法出现在kubernetes中。

当我更正ALLUXIO_WORKER_DATA_SERVER_DOMAIN_SOCKET_ADDRESS =/opt/domain/d的Integration/kubernetes/conf/alluxio.properties中的路径时
然后事情开始正常运作。现在,一些测试也失败了,但从根本上来说,Alluxio的设置已正确启动。现在,我将调试一些测试失败的原因。

我已经在alluxio git中提交了此修复程序,以便他们将其合并到master分支中。
https://github.com/Alluxio/alluxio/pull/7376

关于sockets - 无法在Kubernetes上启动Alluxio,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50759565/

10-10 04:28