日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux用户和HDFS和Hive权限关系

發布時間:2025/4/16 linux 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux用户和HDFS和Hive权限关系 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、Linux用戶組和用戶新建
? ?1)用戶組
? ? ?新建:$groupadd hphs
? ? ?刪除命令:groupdel;
? ? ?屬性修改:groupmod;
? ?2)用戶:
? ? ?新建:#useradd -d /usr/hphs/ -m hphs -g hphs
? ? ?刪除命令:userdel; 帶-r表示刪除用戶相關文件,帶-f 表示強制刪除(即便用戶仍有登錄的)
? ? ?修改賬號:usermod;
? ? ?密碼修改:passwd;
? ?3)用戶組和用戶查看:$cat /etc/passwd


2、賦予HDFS目錄權限:
? ?1)新建hdfs目錄:$hadoop fs -mkdir /user/hphs
? ?2)賦予hphs權限:$hadoop fs -chown -R hphs:hphs /user/hphs
? ?HDFS權限管理用戶指南參考:
? ?http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_permissions_guide.html


3、Hive權限
? ?1)用戶級權限:對于操作系統上用戶進入Hive服務的權限控制,和HDFS權限控制一致,都是ACL支撐。

? ?? <property> <name>hive.metastore.execute.setugi</name> <value>true</value> <description>In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and server sides. Further note that its best effort. If client sets its to true and server sets it to false, client setting will be ignored.簡單說就是,hadoop在非安全模式(未使用kerborers認證)時,使用hive客戶端進程對應的用戶和組權限操作hdfs</description> </property>

? ?2)SQL操作權限:Hive數據庫自身角色的權限管理,不同數據庫和表可賦予具體權限的操作


<property> <name>hive.security.authorization.enabled</name> <value>true</value> <description>enable or disable the hive client authorization.開啟權限驗證</description> </property> <property> <name>hive.security.authorization.createtable.owner.grants</name> <value>ALL</value> <description>the privileges automatically granted to the owner whenever a table gets created. An example like "select,drop" will grant select and drop privilege to the owner of the table.表的創建者對表擁有所有權限. </description> </property>

實際上生產遇到的問題是:

1)新建一個linux用戶和用戶組,Hadoop上如何設置其權限,一個是是否允許執行Hadoop命令;另一個是控制具體HDFS路徑;這個應該就是ACL控制了;

2)新建一個linux用戶和用戶組,Hive上如何設置其權限,一個是否允許自行hive命令;另一個是控制具體hive文件路徑(這點應該和Hadoop一致);再一個就是具體庫和表的使用權限;

決定了如何有效管理多用戶使用hadoop和Hive(再同一客戶端),尤其是hadoop集群設置kerberos安全認證下,有待繼續研究。

此前研究的成果還有待繼續優化:

http://blog.csdn.net/fjssharpsword/article/details/51280335

http://blog.csdn.net/fjssharpsword/article/details/51312153

總結

以上是生活随笔為你收集整理的Linux用户和HDFS和Hive权限关系的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。