GVKun编程网logo

转 Docker ntpdate Permition error

9

最近很多小伙伴都在问转DockerntpdatePermitionerror这两个问题,那么本篇文章就来给大家详细解答一下,同时本文还将给你拓展cephfs:librados:client.boots

最近很多小伙伴都在问转 Docker ntpdate Permition error这两个问题,那么本篇文章就来给大家详细解答一下,同时本文还将给你拓展cephfs:librados: client.bootstrap-mds authentication error (1) Operation not permitted、cephfs:报错 librados: client.admin authentication error (1) Operation not permitted、database – PGError:ERROR:permission denied for relation(当使用Heroku时)、Dockek docker.errors.DockerException: Credentials store 报错解决!等相关知识,下面开始了哦!

本文目录一览:

转 Docker ntpdate Permition error

转 Docker ntpdate Permition error

Docker ntpdate Permition error

        After building a Dockerfile, I run it. I figure out that there is something wrong with local time.

So I start to install ntpdate but it doesn''t work at all. The clock of docker must be asyncronized with

host clock, it can not be changed by itself. The file /etc/localtime is used for setting the system clock

and once it is changed, the time in system will be changed immediately.

      Actually, /etc/localtime is a symlink to /usr/share/zoneinfo/localtime in some Linux/Unix systems.

We can can change /etc/lcoaltime into any one of these timezones as following:

1
2
3
4
5
6
7
8
9
root@ubuntu: /usr/share/zoneinfo # ls
Africa      Canada   EST      GMT0       Iran         MET      Poland      ROK        WET
America     CET      EST5EDT  GMT-0      iso3166.tab  Mexico   Portugal    Singapore  W-SU
Antarctica  Chile    Etc      GMT+0      Israel       MST      posix       SystemV    zone.tab
Arctic      CST6CDT  Europe   Greenwich  Jamaica      MST7MDT  posixrules  Turkey     Zulu
Asia        Cuba     Factory  Hongkong   Japan        Navajo   PRC         UCT
Atlantic    EET      GB       HST        Kwajalein    NZ       PST8PDT     Universal
Australia   Egypt    GB-Eire  Iceland    Libya        NZ-CHAT  right       US
Brazil      Eire     GMT      Indian     localtime    Pacific  ROC         UTC

 

Solution:

1
2
3
4
5
root@6fc515dfb754:~ # ntpdate us.pool.ntp.org
3 Nov 09:30:06 ntpdate[966]: Can''t adjust the time of day: Operation not permitted
 
  
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

cephfs:librados: client.bootstrap-mds authentication error (1) Operation not permitted

cephfs:librados: client.bootstrap-mds authentication error (1) Operation not permitted

创建mds时(ceph-deploy mds create node2)报错:

[node2][INFO  ] Running command: ceph --cluster ceph --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/ceph.keyring auth get-or-create mds.node2 osd allow rwx mds allow mon allow profile mds -o /var/lib/ceph/mds/ceph-node2/keyring
[node2][ERROR ] 2019-10-09 11:51:55.700140 7f907f7c4700  0 librados: client.bootstrap-mds authentication error (1) Operation not permitted
[node2][ERROR ] Error connecting to cluster: PermissionError
[node2][ERROR ] exit code from command was: 1
[ceph_deploy.mds][ERROR ] Could not create mds
[ceph_deploy][ERROR ] GenericError: Failed to create 1 mdss

》1、查看client.bootstrap-mds的key值

[root@node2 mon]# ceph auth get client.bootstrap-mds --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring
exported keyring for client.bootstrap-mds
[client.bootstrap-mds]
        key = AQAmVp1dl+mYGRAADUXZ2WxquEA9+NT8a+jkAQ==
        caps mon = "allow profile bootstrap-mds"
[root@node2 mon]# 

2、修改key值权限

ceph -n mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring auth caps client.bootstrap-mds mds ''allow *'' osd ''allow *'' mon ''allow *''

3、重新执行mds创建命令。

 

总结

以上是小编为你收集整理的cephfs:librados: client.bootstrap-mds authentication error (1) Operation not permitted全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

原文地址:https://www.cnblogs.com/yajun2019/p/11641413.html

cephfs:报错 librados: client.admin authentication error (1) Operation not permitted

cephfs:报错 librados: client.admin authentication error (1) Operation not permitted

执行:ceph -s
2019-10-08 13:52:46.535872 7fb77dc6e700  0 librados: client.admin authentication error (1) Operation not permitted
Error connecting to cluster: PermissionError
[root@node2 ceph]# ceph -s
2019-10-08 15:40:25.631076 7f5f2158c700  0 librados: client.admin authentication error (13) Permission denied
Error connecting to cluster: PermissionDeniedError
[root@node2 ceph]#

 

》(1)ceph -s 的完整命令是:
ceph -s --conf /etc/ceph/ceph.conf --name client.admin --keyring /etc/ceph/ceph.client.admin.keyring
说明此时 client.admin 使用的 key 跟 monitor 记录的 key 不同。
此时可用 monitor 查询 ceph -s,命令如下:
ceph -s --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring  

(2)在 montor 上查询 key:

ceph -s --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring  #查询 monitor 的 key
ceph auth get client.admin --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring   #查询 client 的 key
[root@node2 ceph]# ceph auth get client.admin --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring
exported keyring for client.admin
[client.admin]
        key = AQCSJJxdFjCEORAAMv2j2dtkqswcW1BYfh2H2A==
[root@node2 ceph]#

(3) 将查询到的 client 命令写入:/etc/ceph/ceph.client.admin.keyring 文件,并增加 "r" 权限:

[root@node2 ceph]# cat /etc/ceph/ceph.client.admin.keyring 
[client.admin]
        key = AQCSJJxdFjCEORAAMv2j2dtkqswcW1BYfh2H2A==
        caps mds = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"
[root@node2 ceph]# 
[root@node2 ceph]# ll /etc/ceph/ceph.client.admin.keyring  
-rw-r--r-- 1 root root 129 Oct  8 14:58 /etc/ceph/ceph.client.admin.keyring
[root@node2 ceph]# 

(4) 执行 ceph -s,若还报错,则使用 mon 用户会 client 增加权限:

ceph -n mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring auth caps client.admin mds ''allow *'' osd ''allow *'' mon ''allow *''
 
(5) 此操作后,数据会丢失
[root@node2 ceph]# ceph -s
    cluster 4c137c64-9e09-410e-aee4-c04b0f46294e
     health HEALTH_ERR
            64 pgs are stuck inactive for more than 300 seconds
            64 pgs stuck inactive
            64 pgs stuck unclean
            no osds
     monmap e3: 1 mons at {node2=172.16.18.22:6789/0}
            election epoch 28, quorum 0 node2
     osdmap e1: 0 osds: 0 up, 0 in
            flags sortbitwise,require_jewel_osds
      pgmap v2: 64 pgs, 1 pools, 0 bytes data, 0 objects
            0 kB used, 0 kB / 0 kB avail
                  64 creating
[root@node2 ceph]# 
[root@node2 ceph]# 
[root@node2 ceph]# ceph osd tree
ID WEIGHT TYPE NAME    UP/DOWN REWEIGHT PRIMARY-AFFINITY 
-1      0 root default                                   
[root@node2 ceph]# 

 

 

database – PGError:ERROR:permission denied for relation(当使用Heroku时)

database – PGError:ERROR:permission denied for relation(当使用Heroku时)

我最近经历了如下所述的数据库迁移过程:

https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres

现在我看到在日志中的一些错误,像这样:

PGError:ERROR:关系的权限被拒绝

任何想法,我应该做什么来解决它?

我有一个类似的问题,但根本原因是,我的应用程序指向旧的开发数据库,​​已超过其上限为10,000行。

虽然我创建了一个新的基本数据库并备份一切,应用程序仍指向旧的开发数据库。

heroku pg:info

检查看到的行:10300/10000(那么你有一个问题)

你需要
1)创建具有更多行的新数据库(基本或“生产” – > Heroku似乎强制升级以赚取更多的钱errrrrr)
2)使用pgbackups备份旧数据库:heroku pgbackups:捕获SMALL_DB_NAME
3)将备份还原到新的数据库:heroku pgbackups:还原BIG_DB_NAME BACKUP_ID(有关更多详细信息,请参阅以下链接)
4)将新数据库推送到应用程序的主数据库:heroku pg:promote BIG_DB_NAME

可以总是利用:

heroku maintenance:on (to disable the app while updating)

heroku maintenance:off

heroku pg:info (to check the status)

如果这是问题,你可能想检查:
https://devcenter.heroku.com/articles/heroku-postgres-starter-tier
https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres

Dockek docker.errors.DockerException: Credentials store 报错解决!

Dockek docker.errors.DockerException: Credentials store 报错解决!

报错背景:

之前使用的是老版本的 Docker,今天升级之后发现项目不能使用了,原因是 Python 的驱动和 MysqL 版本不兼容的问题。于是,就把 Docker 回滚到旧版本,但是在执行

docker-compose up -d

的时候使用 control + c 强制关掉,在启动的时候就出错了。。。

MacBook:dev zhangyi$ docker-compose up -d 
Pulling MysqL (MysqL:latest)...
Traceback (most recent call last):
  File "docker-compose",line 6,in <module>
  File "compose/cli/main.py",line 68,in main
  File "compose/cli/main.py",line 121,in perform_command
  File "compose/cli/main.py",line 938,in up
  File "compose/project.py",line 430,in up
  File "compose/service.py",line 311,in ensure_image_exists
  File "compose/service.py",line 1024,in pull
  File "site-packages/docker/api/image.py",line 381,in pull
  File "site-packages/docker/auth.py",line 50,in get_config_header
  File "site-packages/docker/auth.py",line 97,in resolve_authconfig
  File "site-packages/docker/auth.py",line 142,in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('docker-credential-desktop not installed or not available in PATH',)
Failed to execute script docker-compose

根据最后一行的报错提示可知是 DockerMac 下的凭据存储错误,解决办法都是大同小异,就是将 Securely store Docker logins in macOS keychian 这一行勾选去掉!

在这里插入图片描述

结果却是令人失望,还是报同样的错误。

进过思考和测试,发现应该是 docker-compose 是在启动的时候,要往配置里写数据,结果写进了错误的数据。如果找到配置文件删掉应该是可以的!

在这里插入图片描述

在重新启动 docker-compose

卧槽!还真是,WDNMD~

在这里插入图片描述

关于转 Docker ntpdate Permition error的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于cephfs:librados: client.bootstrap-mds authentication error (1) Operation not permitted、cephfs:报错 librados: client.admin authentication error (1) Operation not permitted、database – PGError:ERROR:permission denied for relation(当使用Heroku时)、Dockek docker.errors.DockerException: Credentials store 报错解决!的相关信息,请在本站寻找。

本文标签: