hive 集成sentry

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

环境

apache-hive-2.3.3-bin
apache-sentry-2.1.0-bin
1
2
sentry是目前最新的版本,支持hive的最高版本为2.3.3,hive版本如果高于2.3.3,会出一些版本兼容问题[亲测]

hive快速安装
wget http://mirrors.shu.edu.cn/apache/hive/hive-2.3.3/apache-hive-2.3.3-bin.tar.gz
tar -zxvf apache-hive-2.3.3-bin.tar.gz
1
2
配置hive-site.xml

 mv hive-default.xml.template hive-site.xml
 mkdir -p /home/xiaobin/soft/apache-hive-2.3.3-bin/tmpdir
 vi hive-site.xml
 
   <property>
    <name>system:java.io.tmpdir</name>
    <value>/home/xiaobin/soft/apache-hive-2.3.3-bin/tmpdir</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>master</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mysql://192.168.1.115/hive2?createDatabaseIfNotExist=true&amp;useUnicode=true</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>root</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>123456</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>com.mysql.jdbc.Driver</value>
  </property>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
下载驱动

yum install mysql-connector-java -y
查看安装路径
[root@cluster-master conf]# rpm -qa|grep  mysql-connector-java  
mysql-connector-java-5.1.25-3.el7.noarch
[root@cluster-master conf]# rpm -ql  mysql-connector-java-5.1.25-3.el7.noarch
/usr/share/doc/mysql-connector-java-5.1.25
/usr/share/doc/mysql-connector-java-5.1.25/CHANGES
/usr/share/doc/mysql-connector-java-5.1.25/COPYING
/usr/share/doc/mysql-connector-java-5.1.25/docs
/usr/share/doc/mysql-connector-java-5.1.25/docs/README.txt
/usr/share/doc/mysql-connector-java-5.1.25/docs/connector-j.html
/usr/share/doc/mysql-connector-java-5.1.25/docs/connector-j.pdf
/usr/share/java/mysql-connector-java.jar
/usr/share/maven-fragments/mysql-connector-java
/usr/share/maven-poms/JPP-mysql-connector-java.pom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
copy mysql-connector驱动

cp /usr/share/java/mysql-connector-java.jar apache-hive-2.3.3-bin/lib/
1
创建元数据数据库

mysql> create database hive2;
Query OK, 1 row affected (0.01 sec)
1
2
初始化元数据

schematool -dbType mysql -initSchema
1
sentry安装
下载
http://sentry.apache.org/general/downloads.html
wget http://apache.01link.hk/sentry/2.1.0/apache-sentry-2.1.0-bin.tar.gz
tar -zxvf apache-sentry-2.1.0-bin.tar.gz
1
2
3
config
cp sentry-site.xml.service.example sentry-site.xml
vi sentry-site.xml


<property>
    <name>sentry.hive.server</name>
    <value>server1</value>
  </property>

  <property>
    <name>sentry.verify.schema.version</name>
    <value>true</value>
  </property>


  <property>
    <name>sentry.service.allow.connect</name>
    <value>hive,impala,hue,hdfs</value>
    <description>comma separated list of users - List of users that are allowed to connect to the service (eg Hive, Impala) </description>
  </property>

  <property>
    <name>sentry.store.jdbc.url</name>
    <value>jdbc:mysql://localhost:3306/sentry</value>
    <description>JDBC connection URL for the backed DB</description>
  </property>

  <property>
    <name>sentry.store.jdbc.user</name>
    <value>sentry</value>
    <description>The username of the user that connects to the Sentry database</description>
  </property>

  <property>
    <name>sentry.store.jdbc.password</name>
    <value>sentry</value>
    <description>Sentry password for backend JDBC user </description>
  </property>

  <property>
    <name>sentry.service.server.keytab</name>
    <value></value>
    <description>Keytab for service principal</description>
  </property>

  <property>
    <name>sentry.service.server.rpcport</name>
    <value>8038</value>
    <description> TCP port number for service</description>
  </property>

  <property>
    <name>sentry.service.server.rpcaddress</name>
    <value>0.0.0.0</value>
    <description> TCP interface for service to bind to</description>
  </property>

  <property>
    <name>sentry.store.jdbc.driver</name>
    <value>com.mysql.jdbc.Driver</value>
    <description>Backend JDBC driver - org.apache.derby.jdbc.EmbeddedDriver (only when dbtype = derby) JDBC Driver class for the backed DB</description>
  </property>
 
  <property>
    <name>sentry.service.admin.group</name>
    <value>hive,impala,hue,hdfs</value>
    <description>Comma separates list of groups.  List of groups allowed to make policy updates</description>
  </property>

  <property>
    <name>sentry.store.group.mapping</name>
    <value>org.apache.sentry.provider.common.HadoopGroupMappingService</value>
    <description>
    Group mapping class for Sentry service. org.apache.sentry.provider.file.LocalGroupMapping service can be used for local group mapping. </description>
  </property>

  <property>
    <name>sentry.store.group.mapping.resource</name>
    <value> </value>
    <description> Policy file for group mapping. Policy file path for local group mapping, when sentry.store.group.mapping is set to LocalGroupMapping Service class.</description>
  </property>

  <property>
    <name>sentry.service.security.mode</name>
    <value>none</value>
    <description>Options: kerberos, none.  Authentication mode for Sentry service. Currently supports Kerberos and trusted mode </description>
  </property>
 
  <property>
    <name>sentry.service.server.principal</name>
    <value> </value>
    <description>Service Kerberos principal</description>
  </property>

  <property>
    <name>sentry.service.web.enable</name>
    <value>true</value>
    <description>Enable web service</description>
  </property>

  <property>
    <name>sentry.service.web.authentication.type</name>
    <value>NONE</value>
    <description>Options: kerberos, NONE.  Authentication mode for Sentry web service.</description>
  </property>

  <property>
    <name>sentry.service.web.authentication.kerberos.keytab</name>
    <value></value>
    <description>Keytab for web service principal</description>
  </property>

  <property>
    <name>sentry.service.web.authentication.kerberos.principal</name>
    <value></value>
    <description>Web service Kerberos principal</description>
  </property>

  <property>
    <name>sentry.service.web.authentication.allow.connect.users</name>
    <value></value>
    <description>comma separated list of users - List of users that are allowed to connect to the web service (eg Hive, Impala) </description>
  </property>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
创建sentry元数据数据库

Create Database sentry;
Create User sentry Identified By 'sentry';
Grant All On sentry.* To sentry@'localhost' Identified By 'sentry';
Grant All On sentry.* To sentry@'%' Identified By 'sentry';
flush privileges;
1
2
3
4
5
复制mysql-connector驱动

cp mysql-connector-java.jar apache-sentry-2.1.0-bin/lib/
1
初始化元数据

sentry --command schema-tool --conffile apache-sentry-2.1.0-bin/conf/sentry-site.xml --dbType mysql --initSchema

1
2
启动service

./sentry --command service --conffile apache-sentry-2.1.0-bin/conf/sentry-site.xml
1
查看是否启动成功

netstat -anpl|grep 8038
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:8038            0.0.0.0:*               LISTEN      11950/java
1
2
3
4
hive集成sentry
copy sentry 客户端配置文件

cp apache-sentry-2.1.0-bin/conf/sentry-site.xml.hive-client.example apache-hive-2.3.3-bin/conf/
cd apache-hive-2.3.3-bin/conf/
mv sentry-site.xml.hive-client.example sentry-site.xml
1
2
3
配置$HIVE_HOME/conf/sentry-site.xml

<property>
    <name>sentry.service.security.mode</name>
    <value>none</value>
    <description>Options: kerberos, none.  Authentication mode for Sentry service. Currently supports Kerberos and trusted mode </description>
  </property>
 

  <property>
    <name>sentry.service.client.server.rpc-addresses</name>
    <value>localhost</value>
    <description> TCP address of the sentry store server</description>
  </property>

  <property>
    <name>sentry.service.client.server.rpc-port</name>
    <value>8038</value>
    <description>Port # of the sentry store server</description>
  </property>

  <property>
    <name>sentry.service.client.server.rpc-connection-timeout</name>
    <value>200000</value>
    <description>Client timeout default(200000) RPC connection timeout in milisecs</description>
  </property>

  <property>
    <name>sentry.metastore.service.users</name>
    <value>hive</value>
    <description>
      Comma separated list of users
      List of service users (eg hive, impala) to bypass
      the Sentry metastore authorization. These
      services handle the metadata authorization
      on their side.
    </description>
  </property>

<!--
    Some common client properties same as file
    based provider
-->

  <property>
    <name>sentry.hive.provider</name>
    <value>org.apache.sentry.provider.file.HadoopGroupResourceAuthorizationProvider</value>
    <description> Deprecated name: hive.sentry.provider.  Group mapping which should be used at client side</description>
  </property>

  <property>
    <name>sentry.hive.server</name>
    <value>server1</value>
    <description> Deprecated name: hive.sentry.server.  Defaut: HS2.  Hive Server2 Server identifier like "server1"</description>
  </property>

  <property>
    <name>sentry.hive.failure.hooks</name>
    <value> </value>
    <description>Deprecated Name:  hive.sentry.failure.hooks</description>
  </property>
  
  <property>
        <name>sentry.hive.testing.mode</name>
        <value>true</value>
  </property>

  <property>
    <name>sentry.hive.provider.backend</name>
    <value>org.apache.sentry.provider.db.SimpleDBProviderBackend</value>
    <description> Options: {org.apache.sentry.provider.db.SimpleDBProviderBackend, org.apache.sentry.provider.file.SimpleFileProviderBackend}
      Privilege provider to be used, we support file based or db based
    </description>
  </property>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
vi hive-site.xml

<property>
    <name>hive.metastore.pre.event.listeners</name>
    <value>org.apache.sentry.binding.metastore.MetastoreAuthzBinding</value>
</property>

<property>
    <name>hive.metastore.event.listeners</name>
    <value>org.apache.sentry.binding.metastore.SentrySyncHMSNotificationsPostEventListener</value>
</property>


<property>
    <name>hive.server2.enable.impersonation</name>
    <value>true</value>
</property>

<property>
    <name>hive.security.authorization.task.factory</name>
     <value>org.apache.sentry.binding.hive.SentryHiveAuthorizationTaskFactoryImpl</value>
</property>

<property>
     <name>hive.server2.session.hook</name>
     <value>org.apache.sentry.binding.hive.HiveAuthzBindingSessionHook</value>
</property>

<property>
     <name>hive.sentry.conf.url</name>
     <value>file:///home/xiaobin/soft/apache-hive-2.3.3-bin/conf/sentry-site.xml</value>
</property>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
copy sentry jars

cp apache-sentry-2.1.0-bin/lib/sentry-*.jar  apache-hive-2.3.3-bin/lib/
cp apache-sentry-2.1.0-bin/lib/shiro-*  apache-hive-2.3.3-bin/lib/

1
2
3
启动hiveserver2

hiveserver2 --hiveconf hive.root.logger=INFO,console
1
查看hiveserver2监听端口

 netstat -anpl|grep 10000
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN 
--------------------- 

使用hive用户登陆,在这个hive用户是在$HIVE_HOME/conf/sentry-site.xml中配置,

  <property>
    <name>sentry.metastore.service.users</name>
    <value>hive</value>
  </property>
1
2
3
4
,hive是用于授权的账号,可以理解为超级用户

beeline -u 'jdbc:hive2://localhost:10000' -n hive
1
查看所有roles,当前没有任何role

0: jdbc:hive2://localhost:10000> show roles;
+-------+
| role  |
+-------+
+-------+
1
2
3
4
5
创建admin role:admin_role,

create role admin_role;
GRANT ALL ON SERVER server1 TO ROLE admin_role;
1
2
admin_role拥有server1上的所有权限,server1是再sentry-site.xml中配置

<property>
    <name>sentry.hive.server</name>
    <value>server1</value>
  </property>
1
2
3
4
简单理解拥有admin_role的用户组,拥有所有权限
将hive用户组设置为管理员用户,并使用hive用户创建数据库test

GRANT ROLE admin_role TO GROUP hive;
create database test;


0: jdbc:hive2://localhost:10000> create database test;
No rows affected (0.172 seconds)
0: jdbc:hive2://localhost:10000> show databases;
+----------------+
| database_name  |
+----------------+
| default        |
| filtered       |
| sensitive      |
| test           |
| test1          |
+----------------+
5 rows selected (0.334 seconds)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
创建测试role,并将xn_role分配给xn用户组

0: jdbc:hive2://localhost:10000> create role xn_role;
No rows affected (0.095 seconds)
0: jdbc:hive2://localhost:10000> GRANT ROLE xn_role TO GROUP xn;
No rows affected (0.118 seconds)
1
2
3
4
xn这个拥有xn_role,但是xn_role没有任何权限

使用xn用户登陆
beeline -u 'jdbc:hive2://localhost:10000' -n xn

show databases没有任何库列表输出
0: jdbc:hive2://localhost:10000> show databases;
+----------------+
| database_name  |
+----------------+
| default        |
+----------------+
1 row selected (0.71 seconds)

并且也没有建库权限

0: jdbc:hive2://localhost:10000> create database xn;
Error: Error while compiling statement: FAILED: SemanticException No valid privileges
 User xn does not have privileges for CREATEDATABASE
 The required privileges: Server=server1->action=create->grantOption=false; (state=42000,code=40000)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
现在用hive用户账户创建数据库xn,并将xn_role的权限附给xn;

0: jdbc:hive2://localhost:10000> create database xn
. . . . . . . . . . . . . . . .> ;
No rows affected (0.196 seconds)
0: jdbc:hive2://localhost:10000> GRANT ALL ON DATABASE xn TO ROLE xn_role;
No rows affected (0.1 seconds)
0: jdbc:hive2://localhost:10000> GRANT ROLE xn_role TO GROUP xn;
No rows affected (0.135 seconds)

1
2
3
4
5
6
7
8
使用xn用户登陆

beeline -u 'jdbc:hive2://localhost:10000' -n xn
0: jdbc:hive2://localhost:10000> show databases;
+----------------+
| database_name  |
+----------------+
| default        |
| xn             |
+----------------+
2 rows selected (0.651 seconds)
0: jdbc:hive2://localhost:10000> 
1
2
3
4
5
6
7
8
9
10
查看当前用户roles

0: jdbc:hive2://localhost:10000> SHOW CURRENT ROLES;
+----------+
|   role   |
+----------+
| xn_role  |
+----------+
1 row selected (0.119 seconds)
1
2
3
4
5
6
7
查看xn_role拥有的权限

0: jdbc:hive2://localhost:10000> SHOW GRANT ROLE xn_role;
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| database  | table  | partition  | column  | principal_name  | principal_type  | privilege  | grant_option  |   grant_time   | grantor  |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| xn        |        |            |         | xn_role         | ROLE            | *          | false         | 1540965346000  | --       |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
1 row selected (0.112 seconds)

1
2
3
4
5
6
7
8
给xn_role添加表sensitive.events查询权限

GRANT SELECT ON table sensitive.events TO ROLE xn_role;

0: jdbc:hive2://localhost:10000>  SHOW GRANT ROLE xn_role;
+------------+---------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
|  database  |  table  | partition  | column  | principal_name  | principal_type  | privilege  | grant_option  |   grant_time   | grantor  |
+------------+---------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| xn         |         |            |         | xn_role         | ROLE            | *          | false         | 1540965346000  | --       |
| sensitive  | events  |            |         | xn_role         | ROLE            | SELECT     | false         | 1540971733000  | --       |
+------------+---------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
0: jdbc:hive2://localhost:10000> select * from sensitive.events;
+---------------+-----------------+----------------+----------------+
|   events.ip   | events.country  | events.client  | events.action  |
+---------------+-----------------+----------------+----------------+
| 10.1.2.3      | US              | android        | createNote     |
| 10.200.88.99  | FR              | windows        | updateNote     |
| 10.1.2.3      | US              | android        | updateNote     |
| 10.200.88.77  | FR              | ios            | createNote     |
| 10.1.4.5      | US              | windows        | updateTag      |
+---------------+-----------------+----------------+----------------+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
可以看到xn这个用户已经可以查询表sensitive.events,之前授权的时候只给了select权限,现在来尝试插入一些数据,首先先创建一个表xn.events

0: jdbc:hive2://localhost:10000> create table xn.events as select * from sensitive.events;
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
No rows affected (18.355 seconds)
0: jdbc:hive2://localhost:10000> 

1
2
3
4
5
尝试插入数据

0: jdbc:hive2://localhost:10000> insert into sensitive.events select * from xn.events;
Error: Error while compiling statement: FAILED: SemanticException No valid privileges
 User xn does not have privileges for QUERY
 The required privileges: Server=server1->Db=sensitive->Table=events->action=insert->grantOption=false; (state=42000,code=40000)
1
2
3
4
现在用hive账号给xn_role添加对表sensitive.events的所有权限

0: jdbc:hive2://localhost:10000>  GRANT ALL ON table sensitive.events TO ROLE xn_role;
No rows affected (0.083 seconds)
1
2
查看xn用户权限

0: jdbc:hive2://localhost:10000>  SHOW GRANT ROLE xn_role;
+------------+---------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
|  database  |  table  | partition  | column  | principal_name  | principal_type  | privilege  | grant_option  |   grant_time   | grantor  |
+------------+---------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| xn         |         |            |         | xn_role         | ROLE            | *          | false         | 1540965346000  | --       |
| sensitive  | events  |            |         | xn_role         | ROLE            | *          | false         | 1540972283000  | --       |
+------------+---------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+

1
2
3
4
5
6
7
8
可以看到xn已经又有了对表sensitive.events的所有权限

0: jdbc:hive2://localhost:10000> insert into sensitive.events select * from xn.events;
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
No rows affected (17.397 seconds)
0: jdbc:hive2://localhost:10000> select * from sensitive.events;
+---------------+-----------------+----------------+----------------+
|   events.ip   | events.country  | events.client  | events.action  |
+---------------+-----------------+----------------+----------------+
| 10.1.2.3      | US              | android        | createNote     |
| 10.200.88.99  | FR              | windows        | updateNote     |
| 10.1.2.3      | US              | android        | updateNote     |
| 10.200.88.77  | FR              | ios            | createNote     |
| 10.1.4.5      | US              | windows        | updateTag      |
| 10.1.2.3      | US              | android        | createNote     |
| 10.200.88.99  | FR              | windows        | updateNote     |
| 10.1.2.3      | US              | android        | updateNote     |
| 10.200.88.77  | FR              | ios            | createNote     |
| 10.1.4.5      | US              | windows        | updateTag      |
| 10.1.2.3      | US              | android        | createNote     |
| 10.200.88.99  | FR              | windows        | updateNote     |
| 10.1.2.3      | US              | android        | updateNote     |
| 10.200.88.77  | FR              | ios            | createNote     |
| 10.1.4.5      | US              | windows        | updateTag      |
+---------------+-----------------+----------------+----------------+
15 rows selected (0.412 seconds)
0: jdbc:hive2://localhost:10000>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
数据已经插入到表sensitive.events

现在来看下怎样收回权限,首先来收回xn_role对表的所有权限

0: jdbc:hive2://localhost:10000> REVOKE ALL ON Table sensitive.events from role xn_role;
No rows affected (0.125 seconds)
1
2
查看xn_role的权限

0: jdbc:hive2://localhost:10000>  SHOW GRANT ROLE xn_role;
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| database  | table  | partition  | column  | principal_name  | principal_type  | privilege  | grant_option  |   grant_time   | grantor  |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
| xn        |        |            |         | xn_role         | ROLE            | *          | false         | 1540965346000  | --       |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+
0: jdbc:hive2://localhost:10000> select * from sensitive.events;
Error: Error while compiling statement: FAILED: SemanticException No valid privileges
 User xn does not have privileges for QUERY
 The required privileges: Server=server1->Db=sensitive->Table=events->action=select->grantOption=false; (state=42000,code=40000)
注意
这里账号xn,test,hive均为linux用户,在指定user使用beeline时,linux系统必须要有对应的用户组,否则会报group not exists的错误,或者授权已经成功,但是权限不生效

转载于:https://my.oschina.net/hblt147/blog/2987608

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/388920.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

isql 测试mysql连接_[libco] 协程库学习,测试连接 mysql

历史原因&#xff0c;一直使用 libev 作为服务底层&#xff1b;异步框架虽然性能比较高&#xff0c;但新人学习和使用门槛非常高&#xff0c;而且串行的逻辑被打散为状态机&#xff0c;这也会严重影响生产效率。用同步方式实现异步功能&#xff0c;既保证了异步性能优势&#x…

什么是数据仓库,何时以及为什么要考虑一个

The term “Data Warehouse” is widely used in the data analytics world, however, it’s quite common for people who are new with data analytics to ask the above question.术语“数据仓库”在数据分析领域中被广泛使用&#xff0c;但是&#xff0c;对于数据分析新手来…

探索性数据分析入门_入门指南:R中的探索性数据分析

探索性数据分析入门When I started on my journey to learn data science, I read through multiple articles that stressed the importance of understanding your data. It didn’t make sense to me. I was naive enough to think that we are handed over data which we p…

python web应用_为您的应用选择最佳的Python Web爬网库

python web应用Living in today’s world, we are surrounded by different data all around us. The ability to collect and use this data in our projects is a must-have skill for every data scientist.生活在当今世界中&#xff0c;我们周围遍布着不同的数据。 在我们的…

NDK-r14b + FFmpeg-release-3.4 linux下编译FFmpeg

下载资源 官网下载完NDK14b 和 FFmpeg 下载之后&#xff0c;更改FFmpeg 目录下configure问价如下&#xff1a; SLIBNAME_WITH_MAJOR$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF) LIB_INSTALL_EXTRA_CMD$$(RANLIB)"$(LIBDIR)/$(LIBNAME)" SLIB_INSTALL_NAME$(SLI…

html中列表导航怎么和图片对齐_HTML实战篇:html仿百度首页

本篇文章主要给大家介绍一下如何使用htmlcss来制作百度首页页面。1)制作页面所用的知识点我们首先来分析一下百度首页的页面效果图百度首页由头部的一个文字导航&#xff0c;中间的一个按钮和一个输入框以及下边的文字简介和导航组成。我们这里主要用到的知识点就是列表标签(ul…

C# 依赖注入那些事儿

原文地址&#xff1a;http://www.cnblogs.com/leoo2sk/archive/2009/06/17/1504693.html 里面有一个例子差了些代码&#xff0c;补全后贴上。 3.1.3 依赖获取 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml;//定义…

在FAANG面试中破解堆算法

In FAANG company interview, Candidates always come across heap problems. There is one question they do like to ask — Top K. Because these companies have a huge dataset and they can’t always go through all the data. Finding tope data is always a good opti…

mysql springboot 缓存_Spring Boot 整合 Redis 实现缓存操作

摘要: 原创出处 www.bysocket.com 「泥瓦匠BYSocket 」欢迎转载&#xff0c;保留摘要&#xff0c;谢谢&#xff01;『 产品没有价值&#xff0c;开发团队再优秀也无济于事 – 《启示录》 』本文提纲一、缓存的应用场景二、更新缓存的策略三、运行 springboot-mybatis-redis 工程…

itchat 道歉_人类的“道歉”

itchat 道歉When cookies were the progeny of “magic cookies”, they were seemingly innocuous packets of e-commerce data that stored a user’s partial transaction state on their computer. It wasn’t disclosed that you were playing a beneficial part in a muc…

matlab软件imag函数_「复变函数与积分变换」基本计算代码

使用了Matlab代码&#xff0c;化简平时遇到的计算问题&#xff0c;也可以用于验算结果来自211工科专业2学分复变函数与积分变换课程求复角主值sym(angle(待求复数))%公式 sym(angle(1sqrt(3)*i))%举例代入化简将 代入关于z的函数f(z)中并化解&#xff0c;用于公式法计算无穷远点…

数据科学 python_为什么需要以数据科学家的身份学习Python的7大理由

数据科学 pythonAs a new Data Scientist, you know that your path begins with programming languages you need to learn. Among all languages that you can select from Python is the most popular language for all Data Scientists. In this article, I will cover 7 r…

rabbitmq 不同的消费者消费同一个队列_RabbitMQ 消费端限流、TTL、死信队列

消费端限流1. 为什么要对消费端限流假设一个场景&#xff0c;首先&#xff0c;我们 Rabbitmq 服务器积压了有上万条未处理的消息&#xff0c;我们随便打开一个消费者客户端&#xff0c;会出现这样情况: 巨量的消息瞬间全部推送过来&#xff0c;但是我们单个客户端无法同时处理这…

动量策略 python_在Python中使用动量通道进行交易

动量策略 pythonMost traders use Bollinger Bands. However, price is not normally distributed. That’s why only 42% of prices will close within one standard deviation. Please go ahead and read this article. However, I have some good news.大多数交易者使用布林…

css3 变换、过渡效果、动画

1 CSS3 选择器 1.1 基本选择器 1.2 层级 空格 > .itemli ~ .item~p 1.3 属性选择器 [attr] [attrvalue] [attr^value] [attr$value] [attr*value] [][][] 1.4 伪类选择器 :link :visited :hover :active :focus :first-child .list li:first-child :last-chi…

mysql常用的存储引擎_Mysql存储引擎

什么是存储引擎&#xff1f;关系数据库表是用于存储和组织信息的数据结构&#xff0c;可以将表理解为由行和列组成的表格&#xff0c;类似于Excel的电子表格的形式。有的表简单&#xff0c;有的表复杂&#xff0c;有的表根本不用来存储任何长期的数据&#xff0c;有的表读取时非…

android studio设计模式和文本模式切换

转载于:https://www.cnblogs.com/judes/p/9437104.html

高斯模糊为什么叫高斯滤波_为什么高斯是所有发行之王?

高斯模糊为什么叫高斯滤波高斯分布及其主要特征&#xff1a; (Gaussian Distribution and its key characteristics:) Gaussian distribution is a continuous probability distribution with symmetrical sides around its center. 高斯分布是连续概率分布&#xff0c;其中心周…

C# webbrowser 代理

百度&#xff0c;google加自己理解后&#xff0c;将所得方法总结一下&#xff1a; 方法1&#xff1a;修改注册表Software//Microsoft//Windows//CurrentVersion//Internet Settings下 ProxyEnable和ProxyServer。这种方法适用于局域网用户&#xff0c;拨号用户无效。 1p…

C MySQL读写分离连接串_Mysql读写分离

一 什么是读写分离MySQL Proxy最强大的一项功能是实现“读写分离(Read/Write Splitting)”。基本的原理是让主数据库处理事务性查询&#xff0c;而从数据库处理SELECT查询。数据库复制被用来把事务性查询导致的变更同步到集群中的从数据库。当然&#xff0c;主服务器也可以提供…