Airflow使用入门指南
Airflow能做什么
关注公众号, 查看更多 http://mp.weixin.qq.com/s/xPjXMc_6ssHt16J07BC7jA
Airflow是一个工作流分配管理系统,通过有向非循环图的方式管理任务流程,设置任务依赖关系和时间调度。
Airflow独立于我们要运行的任务,只需要把任务的名字和运行方式提供给Airflow作为一个task就可以。
安装和使用
最简单安装
在Linux终端运行如下命令 (需要已安装好python2.x和pip):
pip install airflow
pip install "airflow[crypto, password]"
- 1
- 2
安装成功之后,执行下面三步,就可以使用了。默认是使用的SequentialExecutor, 只能顺次执行任务。
- 初始化数据库
airflow initdb[必须的步骤] - 启动web服务器
airflow webserver -p 8080[方便可视化管理dag] - 启动任务
airflow scheduler[scheduler启动后,DAG目录下的dags就会根据设定的时间定时启动] - 此外我们还可以直接测试单个DAG,如测试文章末尾的DAG
airflow test ct1 print_date 2016-05-14
最新版本的Airflow可从https://github.com/apache/incubator-airflow下载获得,解压缩按照安装python包的方式安装。
配置 mysql以启用LocalExecutor和CeleryExecutor
安装mysql数据库支持
yum install mysql mysql-server
pip install airflow[mysql]- 1
- 2
设置mysql根用户的密码
ct@server:~/airflow: mysql -uroot #以root身份登录mysql,默认无密码
mysql> SET PASSWORD=PASSWORD("passwd");
mysql> FLUSH PRIVILEGES; # 注意sql语句末尾的分号
- 1
- 2
- 3
- 4
- 5
- 6
新建用户和数据库
# 新建名字为<airflow>的数据库 mysql> CREATE DATABASE airflow; # 新建用户`ct`,密码为`152108`, 该用户对数据库`airflow`有完全操作权限 mysql> GRANT all privileges on airflow.* TO 'ct'@'localhost' IDENTIFIED BY '152108';
mysql> FLUSH PRIVILEGES;- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
修改airflow配置文件支持mysql
airflow.cfg文件通常在~/airflow目录下更改数据库链接
sql_alchemy_conn = mysql://ct:152108@localhost/airflow
对应字段解释如下: dialect+driver://username:password@host:port/database- 1
- 2
初始化数据库
airflow initdb初始化数据库成功后,可进入mysql查看新生成的数据表。
ct@server:~/airflow: mysql -uct -p152108
mysql> USE airflow;
mysql> SHOW TABLES;
+-------------------+
| Tables_in_airflow |
+-------------------+
| alembic_version |
| chart |
| connection |
| dag |
| dag_pickle |
| dag_run |
| import_error |
| job |
| known_event |
| known_event_type |
| log |
| sla_miss |
| slot_pool |
| task_instance |
| users |
| variable |
| xcom |
+-------------------+
17 rows in set (0.00 sec)- 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
centos7中使用mariadb取代了mysql, 但所有命令的执行相同
yum install mariadb mariadb-server
systemctl start mariadb ==> 启动mariadb
systemctl enable mariadb ==> 开机自启动
mysql_secure_installation ==> 设置 root密码等相关
mysql -uroot -p123456 ==> 测试登录!- 1
- 2
- 3
- 4
- 5
配置LocalExecutor
注:作为测试使用,此步可以跳过, 最后的生产环境用的是CeleryExecutor; 若CeleryExecutor配置不方便,也可使用LocalExecutor。
前面数据库已经配置好了,所以如果想使用LocalExecutor就只需要修改airflow配置文件就可以了。airflow.cfg 文件通常在~/airflow目录下,打开更改executor为 executor = LocalExecutor即完成了配置。
把文后TASK部分的dag文件拷贝几个到~/airflow/dags目录下,顺次执行下面的命令,然后打开网址http://127.0.0.1:8080就可以实时侦测任务动态了:
ct@server:~/airflow: airflow initdb` (若前面执行过,就跳过)
ct@server:~/airflow: airflow webserver --debug &
ct@server:~/airflow: airflow scheduler
- 1
- 2
- 3
配置CeleryExecutor (rabbitmq支持)
安装airflow的celery和rabbitmq组件
pip install airflow[celery]
pip install airflow[rabbitmq]- 1
- 2
安装erlang和rabbitmq
- 如果能直接使用
yum或apt-get安装则万事大吉。 - 我使用的CentOS6则不能,需要如下一番折腾,
# (Centos6,[REF](http://www.rabbitmq.com/install-rpm.html)) wget https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_18.3-1~centos~6_amd64.rpm
yum install esl-erlang_18.3-1~centos~6_amd64.rpm
wget https://github.com/jasonmcintosh/esl-erlang-compat/releases/download/1.1.1/esl-erlang-compat-18.1-1.noarch.rpm
yum install esl-erlang-compat-18.1-1.noarch.rpm
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
yum install rabbitmq-server-3.6.1-1.noarch.rpm- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 如果能直接使用
配置rabbitmq
- 启动rabbitmq:
rabbitmq-server -detached - 开机启动rabbitmq:
chkconfig rabbitmq-server on 配置rabbitmq (REF)
rabbitmqctl add_user ct 152108
rabbitmqctl add_vhost ct_airflow
rabbitmqctl set_user_tags ct airflow
rabbitmqctl set_permissions -p ct_airflow ct ".*" ".*" ".*"
rabbitmq-plugins enable rabbitmq_management # no usage- 1
- 2
- 3
- 4
- 5
- 启动rabbitmq:
修改airflow配置文件支持Celery
airflow.cfg文件通常在~/airflow目录下更改executor为
executor = CeleryExecutor-
broker_url = amqp://ct:152108@localhost:5672/ct_airflow
Format explanation: transport://userid:password@hostname:port/virtual_host- 1
- 2
-
# 可以与broker_url相同 celery_result_backend = amqp://ct:152108@localhost:5672/ct_airflow
Format explanation: transport://userid:password@hostname:port/virtual_host- 1
- 2
- 3
- 4
- 5
测试
- 启动服务器:
airflow webserver --debug - 启动celery worker (不能用根用户):
airflow worker - 启动scheduler:
airflow scheduler - 提示:
- 测试过程中注意观察运行上面3个命令的3个窗口输出的日志
- 当遇到不符合常理的情况时考虑清空
airflow backend的数据库, 可使用airflow resetdb清空。 - 删除dag文件后,webserver中可能还会存在相应信息,这时需要重启webserver并刷新网页。
- 关闭webserver:
ps -ef|grep -Ei '(airflow-webserver)'| grep master | awk '{print $2}'|xargs -i kill {}
- 启动服务器:
一个脚本控制airflow系统的启动和重启
#!/bin/bash
#set -x
#set -e
set -u
usage()
{
cat <<EOF
${txtcyn}
Usage:
$0 options${txtrst}
${bldblu}Function${txtrst}:
This script is used to start or restart webserver service.
${txtbld}OPTIONS${txtrst}:
-S Start airflow system [${bldred}Default FALSE${txtrst}]
-s Restart airflow server only [${bldred}Default FALSE${txtrst}]
-a Restart all airflow programs including webserver, worker and
scheduler. [${bldred}Default FALSE${txtrst}]
EOF
}
start_all=
server_only=
all=
while getopts "hs:S:a:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
S)
start_all=$OPTARG
;;
s)
server_only=$OPTARG
;;
a)
all=$OPTARG
;;
?)
usage
exit 1
;;
esac
done
if [ -z "$server_only" ] && [ -z "$all" ] && [ -z "${start_all}" ]; then
usage
exit 1
fi
if [ "$server_only" == "TRUE" ]; then
ps -ef | grep -Ei '(airflow-webserver)' | grep master | \
awk '{print $2}' | xargs -i kill {}
cd ~/airflow/
nohup airflow webserver >webserver.log 2>&1 &
fi
if [ "$all" == "TRUE" ]; then
ps -ef | grep -Ei 'airflow' | grep -v 'grep' | awk '{print $2}' | xargs -i kill {}
cd ~/airflow/
nohup airflow webserver >>webserver.log 2>&1 &
nohup airflow worker >>worker.log 2>&1 &
nohup airflow scheduler >>scheduler.log 2>&1 &
fi
if [ "${start_all}" == "TRUE" ]; then
cd ~/airflow/
nohup airflow webserver >>webserver.log 2>&1 &
nohup airflow worker >>worker.log 2>&1 &
nohup airflow scheduler >>scheduler.log 2>&1 &
fi
- 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
airflow.cfg 其它配置
dags_folder
dags_folder目录支持子目录和软连接,因此不同的dag可以分门别类的存储起来。设置邮件发送服务
smtp_host = smtp.163.com
smtp_starttls = True
smtp_ssl = False
smtp_user = username@163.com
smtp_port = 25
smtp_password = userpasswd
smtp_mail_from = username@163.com- 1
- 2
- 3
- 4
- 5
- 6
- 7
多用户登录设置 (似乎只有CeleryExecutor支持)
- 修改
airflow.cfg中的下面3行配置
authenticate = True
auth_backend = airflow.contrib.auth.backends.password_auth
filter_by_owner = True- 1
- 2
- 3
- 增加一个用户(在airflow所在服务器的python下运行)
import airflow
from airflow import models, settings
from airflow.contrib.auth.backends.password_auth import PasswordUser
user = PasswordUser(models.User())
user.username = 'ehbio'
user.email = 'mail@ehbio.com'
user.password = 'ehbio'
session = settings.Session()
session.add(user)
session.commit()
session.close()
exit()- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 修改
TASK
参数解释
depends_on_pastAirflow assumes idempotent tasks that operate on immutable data
chunks. It also assumes that all task instance (each task for each
schedule) needs to run.If your tasks need to be executed sequentially, you need to
tell Airflow: use thedepends_on_past=Trueflag on the tasks
that require sequential execution.)如果在TASK本该运行却没有运行时,或者设置的
interval为@once时,推荐使用depends_on_past=False。我在运行dag时,有时会出现,明明上游任务已经运行结束,下游任务却没有启动,整个dag就卡住了。这时设置depends_on_past=False可以解决这类问题。timestampin format like2016-01-01T00:03:00Task中调用的命令出错后需要在网站
Graph view中点击run手动重启。
为了方便任务修改后的顺利运行,有个折衷的方法是:- 设置
email_on_retry: True - 设置较长的
retry_delay,方便在收到邮件后,能有时间做出处理 - 然后再修改为较短的
retry_delay,方便快速启动
- 设置
写完task DAG后,一定记得先检测下有无语法错误
python dag.py测试文件1:ct1.py
from airflow import DAG
from airflow.operators import BashOperator, MySqlOperator from datetime import datetime, timedelta one_min_ago = datetime.combine(datetime.today() -
timedelta(minutes=1), datetime.min.time()) default_args = {
'owner': 'airflow', #为了测试方便,起始时间一般为当前时间减去schedule_interval
'start_date': datatime(2016, 5, 29, 8, 30),
'email': ['chentong_biology@163.com'],
'email_on_failure': False,
'email_on_retry': False,
'depends_on_past': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
#'queue': 'bash_queue',
#'pool': 'backfill',
#'priority_weight': 10,
#'end_date': datetime(2016, 5, 29, 11, 30),
} # DAG id 'ct1'必须在airflow中是unique的, 一般与文件名相同 # 多个用户时可加用户名做标记 dag = DAG('ct1', default_args=default_args,
schedule_interval="@once") t1 = BashOperator(
task_id='print_date',
bash_command='date',
dag=dag) #cmd = "/home/test/test.bash " 注意末尾的空格 t2 = BashOperator(
task_id='echo',
bash_command='echo "test" ',
retries=3,
dag=dag) templated_command = """
{% for i in range(2) %}
echo "{{ ds }}"
echo "{{ macros.ds_add(ds, 7) }}"
echo "{{ params.my_param }}"
{% endfor %}
"""
t3 = BashOperator(
task_id='templated',
bash_command=templated_command,
params={'my_param': "Parameter I passed in"},
dag=dag) # This means that t2 will depend on t1 running successfully to run # It is equivalent to t1.set_downstream(t2) t2.set_upstream(t1) t3.set_upstream(t1) # all of this is equivalent to # dag.set_dependency('print_date', 'sleep') # dag.set_dependency('print_date', 'templated')
- 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
测试文件2:
ct2.pyfrom airflow import DAG
from airflow.operators import BashOperator from datetime import datetime, timedelta one_min_ago = datetime.combine(datetime.today() - timedelta(minutes=1),
datetime.min.time()) default_args = {
'owner': 'airflow',
'depends_on_past': True,
'start_date': one_min_ago,
'email': ['chentong_biology@163.com'],
'email_on_failure': True,
'email_on_retry': True,
'retries': 5,
'retry_delay': timedelta(hours=30),
#'queue': 'bash_queue',
#'pool': 'backfill',
#'priority_weight': 10,
#'end_date': datetime(2016, 5, 29, 11, 30),
} dag = DAG('ct2', default_args=default_args,
schedule_interval="@once") t1 = BashOperator(
task_id='run1',
bash_command='(cd /home/ct/test; bash run1.sh -f ct_t1) ',
dag=dag) t2 = BashOperator(
task_id='run2',
bash_command='(cd /home/ct/test; bash run2.sh -f ct_t1) ',
dag=dag) t2.set_upstream(t1)
- 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
run1.sh
#!/bin/bash #set -x set -e
set -u usage()
{
cat <<EOF
${txtcyn}
Usage: $0 options${txtrst} ${bldblu}Function${txtrst}: This script is used to do ********************. ${txtbld}OPTIONS${txtrst}:
-f Data file ${bldred}[NECESSARY]${txtrst}
-z Is there a header[${bldred}Default TRUE${txtrst}]
EOF
} file=
header='TRUE' while getopts "hf:z:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
f)
file=$OPTARG
;;
z)
header=$OPTARG
;;
?)
usage
exit 1
;;
esac
done if [ -z $file ]; then
usage
exit 1
fi cat <<END >$file
A
B
C
D
E
F
G
END sleep 20s- 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
run2.sh
#!/bin/bash #set -x set -e
set -u usage()
{
cat <<EOF
${txtcyn}
Usage: $0 options${txtrst} ${bldblu}Function${txtrst}: This script is used to do ********************. ${txtbld}OPTIONS${txtrst}:
-f Data file ${bldred}[NECESSARY]${txtrst}
EOF
} file=
header='TRUE' while getopts "hf:z:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
f)
file=$OPTARG
;;
?)
usage
exit 1
;;
esac
done if [ -z $file ]; then
usage
exit 1
fi awk 'BEGIN{OFS=FS="\t"}{print $0, "53"}' $file >${file}.out
其它问题
The DagRun object has room for a
confparameter that gets exposed
in the “context” (templates, operators, …). That is the place
where you would associate parameters to a specific run. For now this
is only possible in the context of an externally triggered DAG run.
The way theTriggerDagRunOperatorworks, you can fill in the conf
param during the execution of the callable that you pass to the
operator.If you are looking to change the shape of your DAG through parameters,
we recommend doing that using “singleton” DAGs (using a “@once”schedule_interval), meaning that you would write a
Python program that generates multiple dag_ids, one of each run,
probably based on metadata stored in a config file or elsewhere.The idea is that if you use parameters to alter the shape of your
DAG, you break some of the assumptions around continuity of the
schedule. Things like visualizing the tree view or how to perform a
backfill becomes unclear and mushy. So if the shape of your DAG
changes radically based on parameters, we consider those to be
different DAGs, and you generate each one in your pipeline file.完全删掉某个DAG的信息
set @dag_id = 'BAD_DAG';
delete from airflow.xcom where dag_id = @dag_id;
delete from airflow.task_instance where dag_id = @dag_id;
delete from airflow.sla_miss where dag_id = @dag_id;
delete from airflow.log where dag_id = @dag_id;
delete from airflow.job where dag_id = @dag_id;
delete from airflow.dag_run where dag_id = @dag_id;
delete from airflow.dag where dag_id = @dag_id;supervisord自动管理进程[program:airflow_webserver]
command=/usr/local/bin/python2.7 /usr/local/bin/airflow webserver
user=airflow
environment=AIRFLOW_HOME="/home/airflow/airflow", PATH="/usr/local/bin:%(ENV_PATH)s"
stderr_logfile=/var/log/airflow-webserver.err.log
stdout_logfile=/var/log/airflow-webserver.out.log [program:airflow_worker]
command=/usr/local/bin/python2.7 /usr/local/bin/airflow worker
user=airflow
environment=AIRFLOW_HOME="/home/airflow/airflow", PATH="/usr/local/bin:%(ENV_PATH)s"
stderr_logfile=/var/log/airflow-worker.err.log
stdout_logfile=/var/log/airflow-worker.out.log [program:airflow_scheduler]
command=/usr/local/bin/python2.7 /usr/local/bin/airflow scheduler
user=airflow
environment=AIRFLOW_HOME="/home/airflow/airflow", PATH="/usr/local/bin:%(ENV_PATH)s"
stderr_logfile=/var/log/airflow-scheduler.err.log
stdout_logfile=/var/log/airflow-scheduler.out.log- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
在特定情况下,修改DAG后,为了避免当前日期之前任务的运行,可以使用
backfill填补特定时间段的任务airflow backfill -s START -e END --mark_success DAG_ID
端口转发
之前的配置都是在内网服务器进行的,但内网服务器只开放了SSH端口22,因此
我尝试在另外一台电脑上使用相同的配置,然后设置端口转发,把外网服务器
的rabbitmq的5672端口映射到内网服务器的对应端口,然后启动airflow连接
。ssh -v -4 -NF -R 5672:127.0.0.1:5672 aliyun上一条命令表示的格式为
ssh -R <local port>:<remote host>:<remote port> <SSH hostname>local port表示hostname的portRemote connections from LOCALHOST:5672 forwarded to local address 127.0.0.1:5672-v: 在测试时打开
- -4: 出现错误”bind: Cannot assign requested address”时,force the
ssh client to use ipv4 - 若出现”Warning: remote port forwarding failed for listen port 52698”
,关掉其它的ssh tunnel。
不同机器使用airflow
- 在外网服务器(用做任务分发服务器)配置与内网服务器相同的airflow模块
- 使用前述的端口转发以便外网服务器绕过内网服务器的防火墙访问
rabbitmq 5672端口。 - 在外网服务器启动 airflow
webserverscheduler, 在内网服务器启动airflow worker发现任务执行状态丢失。继续学习Celery,以解决此问题。
安装redis (最后没用到)
- http://download.redis.io/releases/redis-3.2.0.tar.gz
tar xvzf redis-3.2.0.tar.gzandmakeredis-server启动redis- 使用
ps -ef | grep 'redis'检测后台进程是否存在 - 检测6379端口是否在监听
netstat -lntp | grep 6379
任务未按预期运行可能的原因
- 检查
start_date和end_date是否在合适的时间范围内 - 检查
airflow worker,airflow scheduler和airflow webserver --debug的输出,有没有某个任务运行异常 - 检查airflow配置路径中
logs文件夹下的日志输出 - 若以上都没有问题,则考虑数据冲突,解决方式包括清空数据库或着给当前
dag一个新的dag_id
References
- https://pythonhosted.org/airflow/
- http://kintoki.farbox.com/post/ji-chu-zhi-shi/airflow
- http://www.jianshu.com/p/59d69981658a
- http://bytepawn.com/luigi-airflow-pinball.html
- https://github.com/airbnb/airflow
- https://media.readthedocs.org/pdf/airflow/latest/airflow.pdf
- http://www.csdn.net/article/1970-01-01/2825690
- http://www.cnblogs.com/harrychinese/p/airflow.html
- https://segmentfault.com/a/1190000005078547
声明
文章原写于http://blog.genesino.com/2016/05/airflow/。转载请注明出处。
Airflow使用入门指南的更多相关文章
- Web API 入门指南 - 闲话安全
Web API入门指南有些朋友回复问了些安全方面的问题,安全方面可以写的东西实在太多了,这里尽量围绕着Web API的安全性来展开,介绍一些安全的基本概念,常见安全隐患.相关的防御技巧以及Web AP ...
- Vue.js 入门指南之“前传”(含sublime text 3 配置)
题记:关注Vue.js 很久了,但就是没有动手写过一行代码,今天准备入手,却发现自己比菜鸟还菜,于是四方寻找大牛指点,才终于找到了入门的“入门”,就算是“入门指南”的“前传”吧.此文献给跟我一样“白痴 ...
- yii2实战教程之新手入门指南-简单博客管理系统
作者:白狼 出处:http://www.manks.top/document/easy_blog_manage_system.html 本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文 ...
- 【翻译】Fluent NHibernate介绍和入门指南
英文原文地址:https://github.com/jagregory/fluent-nhibernate/wiki/Getting-started 翻译原文地址:http://www.cnblogs ...
- ASP.NET MVC 5 入门指南汇总
经过前一段时间的翻译和编辑,我们陆续发出12篇ASP.NET MVC 5的入门文章.其中大部分翻译自ASP.NET MVC 5 官方教程,由于本系列文章言简意赅,篇幅适中,从一个web网站示例开始讲解 ...
- 一起学微软Power BI系列-官方文档-入门指南(1)Power BI初步介绍
我们在前一篇文章微软新神器-Power BI,一个简单易用,还用得起的BI产品中,我们初步介绍了Power BI的基本知识.由于Power BI是去年开始微软新发布的一个产品,虽然已经可以企业级应用, ...
- 一起学微软Power BI系列-官方文档-入门指南(2)获取源数据
我们在文章: 一起学微软Power BI系列-官方文档-入门指南(1)Power BI初步介绍中,我们介绍了官方入门文档的第一章.今天继续给大家介绍官方文档中,如何获取数据源的相关内容.虽然是英文,但 ...
- 一起学微软Power BI系列-官方文档-入门指南(3)Power BI建模
我们前2篇文章:一起学微软Power BI系列-官方文档-入门指南(1)Power BI初步介绍 和一起学微软Power BI系列-官方文档-入门指南(2)获取源数据 中,我们介绍了官方入门文档与获取 ...
- 一起学微软Power BI系列-官方文档-入门指南(4)Power BI的可视化
在前面的系列文章中,我们介绍了官方有关获取数据,以及建模的原始文档和基本介绍.今天继续给大家介绍官方文档中,有关可视化的内容.实际上获获取数据和建模更注重业务关系的处理,而可视化则关注对数据的解读.这 ...
随机推荐
- 【[NOI2009]管道取珠】
--\(shallwe\):这道题是\(noipDay2T2\)难度 好一个\(Day2T2\)难度啊,我觉得我可以退役了 平方和好像没有什么办法可以快速统计,于是考虑转化一下 我们可以将题意转化成这 ...
- 20165302 预备作业3 Linux安装及学习
linux系统安装 我在安装VirtualBox时出现了一些小问题,如图 我的电脑只能设置32-bit的Ubuntu版本,但教程上说要选用64-bit的,我通过百度查询得知要进行BIOS设置,设置好后 ...
- vue项目 webpack打包后,图片路径是绝对路径
vue项目,使用webpack打包,虽然在全局把路径改成了相对的路径,但是图片引用的路径还是异常的,解决办法如下: 1.config文件夹下index.js中: assetsPublicPath:&q ...
- 回顾C#经典算法冒泡排序
冒泡算法的原理: 比较相邻的两个数字,如果第一个数字比第二个数字大,则交换它们位置 从开始第一对比较到结尾最后一对,最后一个数字就是最大数 除了最后一个数字,再次从开始第一对比较到最后一对,得出第二大 ...
- HDU 1007 Quoit Design(经典最近点对问题)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1007 Quoit Design Time Limit: 10000/5000 MS (Java/Oth ...
- 在CentOS上安装node.js的时候报错:No acceptable C compiler found!解决办法
在CentOS上安装node.js的时候报错:No acceptable C compiler found! 原因:没有c编译器. 解决办法:安装GCC 命令如下: #yum install gcc ...
- 排列组合:01转换法之lua实现
c++ 版连接 https://blog.csdn.net/canguanxihu/article/details/46363375 因为项目用的是lua脚本,看了C++版后自己写了一个lua版本的, ...
- 通过代码退出IOS程序
-(void) tapClick:(UITapGestureRecognizer *)tap{ [UIViewbeginAnimations:@"exitApplication"c ...
- iOS-截取TableView生成图片
先看一下实例效果: 如果所示,这是一个在APP中截图,并调起微信客户端,发送给好友的例子,图片就是一个tableView的截图. 先实现一个小例子,如果tableVIew里面的内容,没有超过当前屏幕显 ...
- node.js 基于cheerio的爬虫工具,需要登录权限的爬虫工具
公司有过一个需求,需要拿一个网页的的表格数据,数据量达到30w左右:为了提高工作效率. 结合自身经验和网上资料.写了一套符合自己需求的nodejs爬虫工具.也许也会适合你的. 先上代码.在做讲解 'u ...