简体   繁体   English

如何将 Nextcloud 置于 kube.netes 的维护模式

[英]How to put Nextcloud in kubernetes in maintenance mode

I'm trying to migrate my Nextcloud instance to a kube.netes cluster.我正在尝试将我的 Nextcloud 实例迁移到 kube.netes 集群。 I've succesfully deployed a Nextcloud instance using openEBS-cStor storage.我已经使用openEBS-cStor存储成功部署了一个 Nextcloud 实例。 Before I can "kubectl cp" my old files to the cluster, I need to put Nextcloud in maintenance mode.在我可以将我的旧文件“kubectl cp”到集群之前,我需要将 Nextcloud 置于维护模式。

This is what I've tried so far:到目前为止,这是我尝试过的:

  • Shell access to pod Shell 访问 pod
  • Navigate to folder导航到文件夹
  • Run OCC command to put next cloud in maintenance mode运行 OCC 命令将下一个云置于维护模式

These are the commands I used for the OCC way:这些是我用于 OCC 方式的命令:

kubectl exec --stdin --tty -n nextcloud nextcloud-7ff9cf449d-rtlxh -- /bin/bash
su -c 'php occ maintenance:mode --on' www-data
# This account is currently not available.

Any tips on how to put Nextcloud in maintenance mode would be appreciated!任何有关如何将 Nextcloud 置于维护模式的提示都将不胜感激!

The su command fails because there is no shell associated with the www-data user. su命令失败,因为没有与www-data用户关联的 shell。

What worked for me is explicitly specifying the shell in the su command:对我有用的是在su命令中明确指定 shell:

su -s /bin/bash www-data -c "php occ maintenance:mode --on"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM