当前位置:网站首页>[nfs无法挂载问题] mount.nfs: access denied by server while mounting localhost:/data/dev/mysql
[nfs无法挂载问题] mount.nfs: access denied by server while mounting localhost:/data/dev/mysql
2022-06-22 18:12:00 【Dream_it_possible!】
centos 7 使用nfs挂载数据卷时出现报错:localhost kubelet: mount.nfs: access denied by server while mounting localhost:/data/dev/mysql
执行Create时,mysql容器一直处于creating状态,mysql-dev-nfs.yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: mysql-dev
labels:
name: mysql-dev
spec:
replicas: 1
selector:
name: mysql-dev
template:
metadata:
labels:
name: mysql-dev
spec:
containers:
- name: mysql
image: nacos/nacos-mysql:5.7
ports:
- containerPort: 3307
volumeMounts:
- name: mysql-data
mountPath: /var/lib/mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "root"
- name: MYSQL_DATABASE
value: "nacos_devtest"
- name: MYSQL_USER
value: "nacos"
- name: MYSQL_PASSWORD
value: "nacos"
volumes:
- name: mysql-data
nfs:
server: localhost
path: /data/dev/mysql
---
apiVersion: v1
kind: Service
metadata:
name: mysql-dev
labels:
name: mysql-dev
spec:
ports:
- port: 3307
targetPort: 3307
nodePort: 30070
selector:
name: mysql-dev
type: NodePort 我想把mysql-data挂载到本机的/data/dev/mysql目录下,使用命令 cat /var/log/messages | grep mount 查看mount相关的日志, 上面一直报错access denied, 下面是解决问题后的日志。
解决方法:
1. 检查系统中是否装有有nfs service, 可使用systemctl status <service_name>查看。

2. 将挂载的目录设置为insecure属性, 执行命令
vim /etc/exports添加如下内容,表示给/data目录赋予权限和insecure。
/data *(insecure,rw,async,no_root_squash)
编辑完后,保存,重启nfs service。

systemctl restart nfs

3. 重新执行 kubectl apply -f service 命令,查看pods是否正常运行。

边栏推荐
- 数字赋能机械制造业,供应链协同管理系统解决方案助力企业供应链再升级
- 贪心之区间问题(2)
- 实验七 触发器
- Makefile does not compile some files
- 远程访问及控制——SSH远程管理及TCP Wrappers 访问控制
- K个一组翻转链表[链表拆解/翻转/拼装]
- 实验4 NoSQL和关系数据库的操作比较
- 【干货|接口测试必备技能-常见接口协议解析】
- Digital enabling machinery manufacturing industry, supply chain collaborative management system solution helps enterprises upgrade their supply chain
- Message Oriented Middleware (I) MQ explanation and comparison of four MQS
猜你喜欢

Active Directory用户登录报告

小波变换db4进行四层分解及其信号重构—matlab分析及C语言实现
Notes on Combinatorics (V) chains in distributive lattice

Typescript (7) generic

Iplook and SBC establish long-term cooperation

PostgreSQL 字符串分隔函数(regexp_split_to_table)介绍以及示例应用

Flutter series - build a flutter development environment

函数的导数与微分的关系

Iplook, as a member of o-ran alliance, will jointly promote the development of 5g industry

Message Oriented Middleware (I) MQ explanation and comparison of four MQS
随机推荐
Shell script (V) -- function
界面开发组件DevExpress ASP.NET Core v21.2 - UI组件增强
故障分析 | 从 data_free 异常说起
Programmer's tool encyclopedia [continuous update]
Thread pool: reading the source code of threadpoolexcutor
Flush difficult to open an account? Is it safe to open an account online?
Error in created hook: “TypeError: Cannot read property ‘tableId‘ of undefined“
Shell编程规范与变量
Zynq UltraScale + RFSoC ZCU111 RF时钟树学习 1
Aiops intelligent operation and maintenance experience sharing
[suggestions collection] common usage scenarios of message queue
2022 t elevator repair recurrent training question bank and answers
How to manage tasks in note taking software such as flowus and notation?
数商云:解析B2B2C多用户商城系统架构设计思路,开启智能商城新时代
How to choose smart home? Take a look at this shopping guide
Pat a 1093 count Pat's (25 points)
canvas给图片画框框
Makefile does not compile some files
集群、分布式、微服务概念和区别
Shell script explanation (IV) -- while loop and until loop of loop statements (additional examples and analysis)