GitLab访问报错:HTTP 502: Whoops, GitLab is taking too much time to respond.

发现一个奇怪的现象,gitlab有时打开报502,多刷几次可以正常打开。所以并不是端口被占用
网上提供了一个分析的方法:
1、gitlab-ctl status
查看进程是否正常启动
2、/var/log/gitlab
下的日志有没有报错
3、gitlab-ctl tail [process name]
查看对应进程的情况

参考资料:
https://www.liangzl.com/get-article-detail-27713.html
https://segmentfault.com/a/1190000017436142

rpmdb: BDB0113 Thread/process 9751/139849321973824 failed: BDB1507 Thread died in Berkeley DB library

yum update时报错:
错误:rpmdb: BDB0113 Thread/process 9751/139849321973824 failed: BDB1507 Thread died in Berkeley DB library
错误:db5 错误(-30973) 来自 dbenv->failchk:BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
错误:无法使用 db5 - (-30973) 打开 Packages 索引
错误:无法从 /var/lib/rpm 打开软件包数据库
CRITICAL:yum.main:
Error: rpmdb open failed

解决办法:
cd /var/lib/rpm
rm -rf __db*
rpm --rebuilddb
yum repolist

再执行:
yum update

yum update异常中断问题

1、由于网络不好,导致yum命令中断,再次执行时提示
Another app is currently holding the yum lock; waiting for it to exit…

2、解决办法
rm -f /var/run/yum.pid
yum install yum-utils
yum clean all
yum-complete-transaction --cleanup-only
yum history redo last

3、安装yum-utils包时提示
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
The program yum-complete-transaction is found in the yum-utils package.

以后yum-utils包要事先安装好

4、RPM数据库错误问题
事务处理完后,执行yum update还是报错:
--> 解决依赖关系完成
错误:软件包:7:device-mapper-libs-1.02.164-7.el7_8.1.x86_64 (@updates)
需要:device-mapper = 7:1.02.164-7.el7_8.1
正在删除: 7:device-mapper-1.02.164-7.el7_8.1.x86_64 (@updates)
device-mapper = 7:1.02.164-7.el7_8.1
更新,由: 7:device-mapper-1.02.164-7.el7_8.2.x86_64 (updates)
device-mapper = 7:1.02.164-7.el7_8.2
可用: 7:device-mapper-1.02.164-7.el7.x86_64 (base)
device-mapper = 7:1.02.164-7.el7
您可以尝试添加 --skip-broken 选项来解决该问题
** 发现 6 个已存在的 RPM 数据库问题, 'yum check' 输出如下:
7:device-mapper-libs-1.02.164-7.el7_8.2.x86_64 是 7:device-mapper-libs-1.02.164-7.el7_8.1.x86_64 的副本
7:device-mapper-libs-1.02.164-7.el7_8.2.x86_64 有缺少的需求 device-mapper = ('7', '1.02.164', '7.el7_8.2')
mesa-khr-devel-18.3.4-7.el7_8.1.x86_64 是 mesa-khr-devel-18.3.4-7.el7.x86_64 的副本
mesa-libglapi-18.3.4-7.el7_8.1.x86_64 是 mesa-libglapi-18.3.4-7.el7.x86_64 的副本
systemd-219-73.el7_8.6.x86_64 是 systemd-219-73.el7_8.5.x86_64 的副本
systemd-libs-219-73.el7_8.6.x86_64 是 systemd-libs-219-73.el7_8.5.x86_64 的副本
Warning: Some duplicates were not removed because they are required by installed packages.
You can try --cleandupes with --removenewestdupes, or review them with --dupes and remove manually.

现象是本机rpm数据库里记录了某个rpm包多个版本(可能事实上只装了一个版本)

查看软件包信息,发现存在多条信息:
rpm -qa | grep systemd
systemd-libs-219-73.el7_8.6.x86_64
systemd-219-73.el7_8.6.x86_64
systemd-libs-219-73.el7_8.5.x86_64
systemd-219-73.el7_8.5.x86_64
systemd-sysv-219-73.el7_8.5.x86_64

多了两条重复的:
systemd-libs-219-73.el7_8.5.x86_64
systemd-219-73.el7_8.5.x86_64

先解决xxx是xxx的副本:
rpm -e --noscripts device-mapper-libs-1.02.164-7.el7_8.2.x86_64
rpm -e --noscripts mesa-khr-devel-18.3.4-7.el7_8.1.x86_64
rpm -e --noscripts mesa-libglapi-18.3.4-7.el7_8.1.x86_64
rpm -e --noscripts systemd-219-73.el7_8.6.x86_64
rpm -e --noscripts systemd-libs-219-73.el7_8.6.x86_64

清理冲突:
package-cleanup --cleandupes

重新执行yum update,解决

标准普尔象限图

标普家庭资产象限图根据资金用途把家庭资产分为四个类别,分别为要花的钱、保命的钱、生钱的钱和保本升值的钱,四类资产的占比分别为10%、20%、30%和40%

1、要花的钱:指的是日常的生活费开销,如衣食住行乐都包含在里面,大概要储备3-6个月的生活费才算充足,这样即使出现开支意外增大或者收入突然停止的情况,也可以保证家庭的正常生活短期不受影响
2、保命的钱:指的主要是用于保险保障的开支,提前为家人购买充足的重疾险、意外险、医疗险、寿险,从而避免陷入因病返贫的困境
3、生钱的钱:指的是用于投资的钱,主要以获取收益为目的,通过聪明地承担风险获取较高的收益,比如股票、房产、黄金、期货、外汇、实业等各种形式的投资
4、保本升值的钱:指的是追求稳健增值的钱,这类资金未来有明确用途因此不能亏损,但短期暂时不用因此需要保值增值,比如子女教育金、养老金就属于这一类,此类资金风险承受能力较低,以安全为前提,然后能够适度增值更好。可主要投向货币基金、债券、定期存款、分红保险等稳健增值类产品

Docker学习(6)—容器中wordpress更新时提示登陆ftp

原因为nginx对目录没有写文件权限,代码是存在宿主机的,文件夹权限为root用户

1、登陆nginx容器环境
docker exec -it nginx /bin/bash

2、查看目录/var/www/html都是root用户权限
ls -al /var/www/html

3、查看容器用户
cat /etc/passwd
发现:
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
而nginx一般是用www-data用户来运行,它的家目录就是/var/www

4、将/var/www下改为www-data用户
cd /var/www
chown -R www-data:www-data ./

5、再次尝试,可以更新了

6、查看宿主机目录权限有没有变
ls -al /appserver/code/
drwxr-xr-x 8 33 33 4096 4月 12 08:19 wordpress

也变成了uid为33,因为是目录映射到容器中。容器中的改动也反映在宿主机上

20200405

清明节记事。

2020年真是奇幻的开始,澳洲大火,新冠疫情,奥运延期,美股熔断,大家见证了好多次历史。也许以后回想起这段时光,会想到电视里奋战的医护人员、小区门口测体温的居委会阿姨、商店里进店必须带口罩的提醒,每个人都有自己的片段。

这里记录下收到的几十条公共短信,疫情期间的缩影吧。

继续阅读20200405

centos安装gitlab-ce

1、gitlab是什么
gitlab是git仓库的管理工具,提供web页面方便用户使用。
gitlab-ce和gitlab-ee,ce是社区版,ee是企业版,企业版有些功能需要付费使用。

2、从官方仓库上安装gitlab
添加官方仓库:
curl -L https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

3、安装postfix
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

4、安装gitlab
yum install gitlab-ce

5、安装完成后会有提示信息
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

GitLab now ships with a newer version of PostgreSQL (11.7), but it is not yet
enabled by default. To upgrade, please see:
https://docs.gitlab.com/omnibus/settings/database.html#upgrade-packaged-postgresql-server

6、编辑/etc/gitlab/gitlab.rb
将:
# nginx['listen_port'] = nil
修改为:
nginx['listen_port'] = 8888
将:
external_url 'http://gitlab.example.com'
修改为:
external_url 'http://你的IP地址:8888'
注:这里external_url需要加上端口,否则使用http克隆和查看文件,链接里会没有端口

继续阅读centos安装gitlab-ce

oracle bitand函数

语法:
BITAND(nExpression1, nExpression2)

说明:
指定按位进行AND运算的两个数值。如果nExpression1和nExpression2的位都是1,相应的结果位就是1;否则相应的结果位是0

例子:
select bitand(5, 7) from dual;
———-
5

说明:
5的二进制格式:0101
7的二进制格式:0111
计算结果:0101,转换为十进制为5

参考资料:
https://blog.csdn.net/qq_25662627/article/details/81096605

软件及互联网爱好者