samba server导出/datasmb/目录;samba client挂载/data/至本地的/mydata目录;本地的mysqld或mariadb服务的数据目录设置为/mydata, 要求服务能正常启动,且可正常 存储数据;
实验环境:CentOS7
主机(mini2) :172.16.250.247 主机名:;localhost
客户端(mini3):172.16.253.99 主机名:pxe99
#主机:配置文件的备份,修改配置文件
[root@~ localhost]#mkdir /datasmb
[root@~ localhost]#cd /etc/samba/
[root@samba localhost]#cp -av smb.conf{,.bak}
[root@samba localhost]#cp -av smb.conf.example{,.bak}
[root@samba localhost]#mv smb.conf.example smb.conf
[root@samba localhost]#vim smb.conf
[files] #共享系统名
comment = mysql test
path = /datasmb #路径
public = no #不公开,仅部分用户可见
write list = sqltest #可写
browseable = no #不可浏览,不可看
[root@samba localhost]#testparm
[root@samba localhost]#systemctl start nmb.service smb.service
[root@samba localhost]#ss -ntlu |egrep "137|138|139|445"
udp UNCONN 0 0 172.16.255.255:137 *:*
udp UNCONN 0 0 172.16.250.247:137 *:*
udp UNCONN 0 0 *:137 *:*
udp UNCONN 0 0 172.16.255.255:138 *:*
udp UNCONN 0 0 172.16.250.247:138 *:*
udp UNCONN 0 0 *:138 *:*
tcp LISTEN 0 50 *:139 *:*
tcp LISTEN 0 50 *:445 *:*
tcp LISTEN 0 50 :::139 :::*
tcp LISTEN 0 50 :::445 :::*
#添加samba用户
[root@samba localhost]#useradd sqltest
[root@samba localhost]#pdbedit -a -u sqltest
new password:
retype new password:
Unix username: sqltest
[root@~ pxe99]#yum -y install samba samba-client
[root@~ pxe99]#yum -y install mariadb-server
[root@~ pxe99]#systemctl start mariadb.service
[root@~ pxe99]#ss -ntl |grep "3306"
[root@~ pxe99]#mysql_secure_installation
[root@~ pxe99]#systemcel stop mariadb.service
[root@etc pxe99]#cd /etc/my.cnf.d/
[root@etc pxe99]#vim server.cnf
[mysqld]
skip_name_resolve=ON
innodb_file_per_table=ON
log_bin=mysql-bin
[root@etc pxe99]#vim /etc/my.cnf
[mysqld]
datadir=/mydata
#新建数据目录
[root@etc pxe99]#mkdir /mydata
[root@etc pxe99]#chown mysql:mysql /mydata
[root@etc pxe99]#ll -d /mydata /var/lib/mysql/
drwxr-xr-x 2 mysql mysql 4096 Jun 10 20:37 /mydata
drwxr-xr-x 5 mysql mysql 4096 Jun 10 20:26 /var/lib/mysql/ [root@etc pxe99]#systemctl start mariadb.service
[root@etc pxe99]#ss -ntl |grep "3306"
LISTEN 0 50 *:3306 *:*
#挂载
[root@etc pxe99]#mount -t cifs -o username=sqltest,password=123456 //172.16.250.247/sqltest /mydata
#数据库操作:
[root@mysql pxe99]#mysql
MariaDB [(none)]> CREATE DATABASE smb; MariaDB [smb]> GRANT ALL ON smb.* TO smb@'172.16.253.99' IDENTIFIED BY "123456";
MariaDB [smb]> GRANT ALL ON smb.* TO smb@'127.0.0.1' IDENTIFIED BY "123456"
MariaDB [smb]> GRANT ALL ON smb.* TO smb@'172.16.250.247' IDENTIFIED BY "123456"
MariaDB [smb]> FLUSH PRIVILEGES;
#修改权限
#主机
[root@datasmb localhost]#setfacl -m u:sqltest:rwx /datasmb/ #客户端
[root@mysql pxe99]#setfacl -m u:mysql:rwx /mydata/
samba server导出/datasmb/目录;samba client挂载/data/至本地的/mydata目录;本地的mysqld或mariadb服务的数据目录设置为/mydata, 要求服务能正常启动,且可正常 存储数据;的更多相关文章
- How to configure Samba Server share on Debian 9 Stretch Linux
Lubos Rendek Debian 13 June 2017 Contents 1. Objective 2. Operating System and Software Versions 3. ...
- How to install Samba server on Ubuntu 12.04
Part 1: Configuring anonymous share with samba server To install the samba package,enter the followi ...
- 8.samba server与client配置
server端 1.安装samba:yum install -y samba\* 增加samba用户: useradd smb用户名 smbpasswd -a smb用户名 ...
- samba服务和client挂载
服务端 1.安装samba服务 yum -y install samba 2.创建系统用户 因为Samba 服务程序的数据库要求账户必须在当前系统中已经存在,否则日后创建文件时将导致文件的权限属性混乱 ...
- samba server install
要求: create vnc service for win7 access it via vnc viewer. 1TB disk for this Centos PC is used as Sam ...
- Samba Server 配置
1.Issue:Server requested plaintext password but 'client plaintext auth' is disabled session setup ...
- samba server 设置
samba server 设置yum install samba.x86_64systemctl start smb.servicesystemctl enable smb.servicesamb ...
- The Guideline of Setting Up Samba Server on linux(Ubuntu)
The Guideline of Setting Up Samba Server on linux(Ubuntu) From terminate command window, install the ...
- How To Configure SAMBA Server And Transfer Files Between Linux & Windows
If you are reading this article it means you have a network at home or office with Windows and Linux ...
随机推荐
- 使用asn1tools进行asn1编解码
最近在做3GPP的编解码,发现有两个第三方库比较好用.一个是ASN1C(c语言编译环境),一个是python第三方库asn1tools.这里介绍下asn1tools的使用方法: 1 第一步:生成asn ...
- iOS8 with Swift
Ref:iOS8 Day-by-Day Ref:iOS8-day-by-day source Ref:Let's Swift Ref:Swift 代码库 Ref:iOS Apprentice Thir ...
- PHP-内嵌式语言(转)(未看)
PHP,一个嵌套的缩写名称,是英文超级文本预处理语言(PHP:Hypertext Preprocessor)的缩写.PHP 是一种内嵌式的语言,PHP与微软的ASP颇有几分相似,都是一种在服务器端执行 ...
- java面试_数据库
1.group by 根据表里的字段名分类,相同字段名只显示一行记录,通常与聚集函数max.min合用选择最大值最小值,或者与having合用筛选,结果按照group by的字段排序 例:select ...
- 第一天 格式化操作符 条件、for、while、break、continue语句
python2和3的区别: 2中的print 不必加括号 3中的print变为函数 要加括号 2中的input不能输入字母(输入的字母被认为是变量,而之前又没定义,所以报错),默认只能计算数字,要 ...
- Spring Cloud之整合ZK作为注册中心
Eureka已经闭源了,用zk可以替代之 Eureka 作为注册中心 Dubbo也是zk作为注册中心的 Zookeeper简介 Zookeeper是一个分布式协调工具,可以实现服务注册与发现.注册中心 ...
- ML2 Extension Manager
The extension manager for ML2 was introduced in Juno (more details can be found in the approvedspec) ...
- java:Maven构建项目速度太慢的解决办法,以及报错Retrieving archetypes:' has encountered a problem
如果报错信息如下: Retrieving archetypes:' has encountered a problemAn internal error occurred during:"R ...
- Delphi webservices 传数据
数据集数据转换为XML function ReplaceString(AString: string): string; begin Result := StringReplace(AString, ...
- LSM Tree 学习笔记——本质是将随机的写放在内存里形成有序的小memtable,然后定期合并成大的table flush到磁盘
The Sorted String Table (SSTable) is one of the most popular outputs for storing, processing, and ex ...