yugabyte 安装pg_hashids 扩展
主要目的比较简单,就是测试下yugabyte 对于pg 扩展的支持,今天在测试plv8的时候发现有问题(以及提交issue了,很期待官方的解决)
所以测试下一个其他的扩展,看看是否像官方介绍的那样
环境准备
- 说明
环境基于docker 运行,同时pg_hashids 扩展也基于docker 构建,之后copy yugabyte 扩展安装目录 - pg_hashids dockerfile
FROM postgres:11.2
ENV PG_HASHIDS=v1.2.1
LABEL EMAIL="1141591465@qq.com"
LABEL AUTHOR="dalongrong"
RUN buildDependencies="curl build-essential ca-certificates git pkg-config postgresql-server-dev-$PG_MAJOR" \
&& apt-get update \
&& apt-get install -y --no-install-recommends libc++1 ${buildDependencies} \
&& mkdir -p /tmp/build \
&& cd /tmp/build \
&& git clone https://github.com/iCyberon/pg_hashids.git /tmp/build/pg_hashids \
&& cd /tmp/build/pg_hashids \
&& make && make install \
&& cd / \
&& apt-get clean \
&& apt-get remove -y ${buildDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/build /var/lib/apt/lists/*
- yugabyte 集群
基于docker-compose 运行
version: '2'
services:
yb-master:
image: yugabytedb/yugabyte:latest
container_name: yb-master-n1
command: [ "/home/yugabyte/bin/yb-master",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--master_addresses=yb-master-n1:7100",
"--replication_factor=1"]
ports:
- "7000:7000"
environment:
SERVICE_7000_NAME: yb-master
yb-tserver:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-n1
command: [ "/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--start_pgsql_proxy",
"--tserver_master_addrs=yb-master-n1:7100"]
ports:
- "9042:9042"
- "6379:6379"
- "5433:5433"
- "9000:9000"
environment:
SERVICE_5433_NAME: ysql
SERVICE_9042_NAME: ycql
SERVICE_6379_NAME: yedis
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master
yb-tserver2:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-n2
command: [ "/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--start_pgsql_proxy",
"--tserver_master_addrs=yb-master-n1:7100"]
ports:
- "9043:9042"
- "6380:6379"
- "5434:5433"
- "9001:9000"
environment:
SERVICE_5433_NAME: ysql
SERVICE_9042_NAME: ycql
SERVICE_6379_NAME: yedis
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master
启动&&扩展copy
- 启动服务
docker-compose up -d
- 启用ysql
新版本的好像默认,就启用了,后边在仔细测试下
docker-compose exec yb-master bash -c "YB_ENABLED_IN_POSTGRES=1 FLAGS_pggate_master_addresses=yb-master-n1:7100 /home/yugabyte/postgres/bin/initdb -D /tmp/yb_pg_initdb_tmp_data_dir -U postgres"
- copy 扩展
为了测试,我已经copy 出构建好的扩展到本地
docker cp hashids/pg_hashids.so yb-tserver-n1:/home/yugabyte/postgres/lib
docker cp hashids/pg_hashids.so yb-tserver-n2:/home/yugabyte/postgres/lib
docker cp hashids/extension/. yb-tserver-n1:/home/yugabyte/postgres/share/extension
docker cp hashids/extension/. yb-tserver-n2:/home/yugabyte/postgres/share/extension
扩展测试
- 启动扩展
CREATE EXTENSION pg_hashids;
- 调用函数
SELECT id_encode(1001);
- 效果

参考资料
https://github.com/iCyberon/pg_hashids
https://github.com/rongfengliang/yugabytedb-jaeger-docker-compose
https://github.com/rongfengliang/pg_hashids_docker
https://docs.yugabyte.com/latest/api/ysql/extensions/
https://hashids.org/
yugabyte 安装pg_hashids 扩展的更多相关文章
- pecl 轻松安装php扩展
PECL 的全称是 The PHP Extension Community Library ,是一个开放的并通过 PEAR(PHP Extension and Application Reposito ...
- 编译安装PHP7并安装Redis扩展Swoole扩展
编译安装PHP7并安装Redis扩展Swoole扩展 在编译php7的机器上已经有编译安装过php5.3以上的版本,从而依赖库都有了 本php7是编译成fpm-php 使用的, 如果是apache那么 ...
- 使用phpize安装php扩展
环境: CentOs 6.3 php 7 nginx 举例: 安装ssh2扩展 1.登陆http://pecl.php.net,搜索ssh2,如下图所示,注意版本的选择要根据php的版本来 2.下载s ...
- centos下安装php扩展php-memcached
说来坎坷,为了安装这个php的扩展php-memcached,连操作系统都换了,从centos5.5升级到了centos6.8!! centos5.5中在安装php扩展php-memcached的依赖 ...
- 如何正确使用 Composer 安装 Laravel 扩展包
我们经常要往现有的项目中添加扩展包,有时候因为文档的错误引导,如下图来自 这个文档 的: composer update 这个命令在我们现在的逻辑中,可能会对项目造成巨大伤害. 因为 composer ...
- win10 64位安装memcache扩展和开启redis扩展
前面有关于win10下搭建wamp环境的介绍,在此不在赘述,php操作memcache有memcache库和memcached库,其中memcache是php内置的扩展库,支持面向对象和面向过程两种操 ...
- Linux下,如何给PHP安装pdo_mysql扩展
下载了一个免费开源的广告系统(openadserver),在Linux上安装时,提示要安装 pdo_mysql 扩展,先前有过编译安装 soap扩展 的经历,今天要编译安装 pdo_mysql 扩展, ...
- [Linux][PHP]安装swoole扩展
1.下载swoole 2.解压并配置 /usr/local/php/bin/phpize ./configure --enable-swoole-debug --enable-sockets --en ...
- lnmp---------------lnmp1.3-full安装包安装lnmp环境,如何安装PHP扩展
1. 如果已经安装LNMP套件,请按以下步骤处理 a. 跳转到fileinfo源代码目录` cd /root/downloads/lnmp1.2-full/src/php-7.0.7/ext/file ...
随机推荐
- 一个网页从输入URL到页面加载完成的过程中都发生了什么事情?
这是一个前端的经典面试题,很多大公司面试时都会被问及,涉及的面也是非常多. 一般会经历以下几个过程: 1.首先,在浏览器地址栏中输入url 2.浏览器先查看浏览器缓存-系统缓存-路由器缓存,如果缓存中 ...
- linux内核debug的一种方式:procfs
#include <linux/module.h> #include <linux/compat.h> #include <linux/types.h> #incl ...
- Windbg断点调试.net程序
程序员都知道,在生产环境中,如果没有系统日志,对问题的分析将非常的困难.即使有日志,有时候也会因为日志记录的不全面,而导致问题不能分析清楚.其实,Windbg里面有Live Debug功能,正好可以借 ...
- 百度前端技术学院task1.10
任务十:Flexbox 布局练习 面向人群: 有一定HTML及CSS基础的同学 难度: 中 重要说明 百度前端技术学院的课程任务是由百度前端工程师专为对前端不同掌握程度的同学设计.我们尽力保证课程内容 ...
- excel中统计列中的值在其他列出现的次数多个条件
excel中统计列中的值在其他列出现的次数多个条件 =COUNTIFS(E2:E373,"=VIP经销商",J2:J373,K2) 解释 E列的第二行到第373行中值 等于 VIP ...
- html 快速布局
1.每个单词的首字母大写 一般我们会用JS实现,其实CSS就可以实现.JS代码: var str = 'hello world'; str.replace(/( |^)[a-z]/g,(L)=> ...
- 求x到y的最少计算次数
链接:https://www.nowcoder.com/questionTerminal/45d04d4d047c48768543eeec95798ed6?orderByHotValue=1& ...
- 使用XSSFWorkbook 读取excel
工作中用到 使用XSSFWorkbook 读取excel 具体代码如下, private (List<(string columnName, string colomnDescription)& ...
- .NetCore使用NLog写入数据库总结
考虑到项目后期添加日志的需求,抽个闲暇时间学习一下使用NLog插件将日志信息写入到数据库中,完整项目见下面: 遇到的问题: 使用NLog写到SQLServer里面的中文显示问号? 解决方法:调整数据库 ...
- asp.net core流式上传大文件
asp.net core流式上传大文件 首先需要明确一点就是使用流式上传和使用IFormFile在效率上没有太大的差异,IFormFile的缺点主要是客户端上传过来的文件首先会缓存在服务器内存中,任何 ...