Archive

Posts Tagged ‘AWS’

PostgreSql查询正在执行的SQL和查询执行耗时的SQL

November 9th, 2018 No comments

运行在AWS RDS上的PostgreSql今天TransactionID耗尽,原因是有一个SQL执行占用CPU超过12小时

–查询正在执行的SQL

1
select * from pg_stat_activity where datname='schema名称';

–结束正在进行的R查询

1
select pg_cancel_backend(pid);

–结束正在执行CUD操作

1
select  pg_terminate_backend(pid)

Read more…

Categories: 系统管理, 语言编程 Tags: , ,

[CentOS] 使用s3fs-fuse挂载S3Bucket到本地分区

November 9th, 2018 No comments

准备工作
1.创建接入S3 Bucket的IAM用户
2.创建S3 Bucket,赋予IAM用户读写S3 Bucket的权限

测试环境
Amazon AMI Linux
CentOS 7.5

s3fs
s3fs allows Linux and macOS to mount an S3 bucket via FUSE. s3fs preserves the native object format for files, allowing use of other tools like s3cmd.

STEP1. 安装s3fs-fuse相关依赖包

1
2
 # install automake fuse fuse-devel gcc-c++ git \
 libcurl-devel libxml2-devel make openssl-devel

STEP2.下载s3fs-fuse,编译安装s3fs-fuse

1
2
3
4
5
6
7
# cd /usr/local/
# git clone https://github.com/s3fs-fuse/s3fs-fuse.git
# cd s3fs-fuse
# ./autogen.sh
# ./configure
# make
# make install

Read more…

Categories: 系统管理 Tags: , ,