我想在旧电脑上构建一个低端 6TB RAID 1 存档。
MB: Intel d2500hn 64bit
CPU: Intel Atom D2500
RAM: 4GB DDR3 533 MHz
PSU: Chinese 500W
NO GPU
1x Ethernet 1Gbps
2x SATA2 ports
1x PCI port
4x USB 2.0
Run Code Online (Sandbox Code Playgroud)
我想在 Linux 上构建一个 RAID1 存档(我认为是 CentOS 7,然后我会安装我需要的所有东西,我认为ownCloud或类似的东西),我将在我的家庭本地网络中使用它。
10-20 美元的RAID PCI 控制器还是软件RAID 更好?
如果软件raid比较好,我在CentOS上应该选择哪个?是将系统放在外部 USB 上并在连接器上使用 2 个磁盘,还是应该将系统放在一个磁盘中然后创建 RAID?
如果我要做 3 个磁盘的 RAID 5,我应该选择硬件 raid PCI 还是简单的 PCI SATA 连接器?
我想为 Centos 7 中的所有用户永久设置打开文件限制,但在谷歌上似乎有很多相互矛盾的信息。
尝试运行任何 rpm 命令时,出现以下错误。我不确定为什么会出现 curl 错误,但我尝试了许多不同的选项,但都失败了。
运行 CentOS7 并在代理后面
[root@CentOS7]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
curl: (60) Peer's certificate issuer has been marked as not trusted by the user.
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in …Run Code Online (Sandbox Code Playgroud) 运行yum install https://extras.getpagespeed.com/redhat/7/noarch/RPMS/getpagespeed-extras-release-7-1.el7.gps.noarch.rpm创建/etc/cron.d/sysstat2但 RPM 拒绝文件:
# rpm -ql getpagespeed-extras-release
/etc/pki/rpm-gpg/RPM-GPG-KEY-GETPAGESPEED
/etc/yum.repos.d/getpagespeed-extras.repo
# rpm -qf /etc/cron.d/sysstat2
file /etc/cron.d/sysstat2 is not owned by any package
Run Code Online (Sandbox Code Playgroud)
RPM 是如何创建文件的,我如何查看它还有什么作用?
SELinux 阻止apache用户写入它拥有的日志文件。当我这样做setenforce 0时。否则显示此错误
IOError: [Errno 13] Permission denied: '/var/www/webapp/k/site/k.log'
Run Code Online (Sandbox Code Playgroud)
文件的安全上下文:
$ ll -Z k.log
-rw-r--r--. apache apache system_u:object_r:httpd_sys_content_t:s0 k.log
Run Code Online (Sandbox Code Playgroud)
该文件是在 SELinux 模式设置为 permissive 时创建的。
如何设置安全上下文以便apache用户可以在该目录中写入?我确实使用了该目录安全上下文,chcon但我找不到合适的文件类型。
来自audit.log:
type=AVC msg=audit(1409945481.163:1561): avc: denied { append } for pid=16862 comm="httpd" name="k.log" dev="dm-1" ino=201614333 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file
type=SYSCALL msg=audit(1409945481.163:1561): arch=c000003e syscall=2 success=no exit=-13 a0=7fa8080847a0 a1=441 a2=1b6 a3=3 items=0 ppid=15256 pid=16862 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
Run Code Online (Sandbox Code Playgroud)
我已经在 Centos 7 中安装了 ZFS(0.6.5) 并且我还创建了一个 zpool,除了我的数据集在重新启动时消失之外,一切正常。
我一直在尝试借助各种在线资源和博客来调试此问题,但无法获得理想的结果。
重新启动后,当我发出zfs list命令时,我得到"no datasets available",并zpool list给出了"no pools available"
经过大量在线研究,我可以通过使用zpool import -c cachefile手动导入缓存文件来使其工作,但是我仍然必须在重新启动之前运行zpool set cachefile=/etc/zfs/zpool.cache Pool以便在重新启动后稍后导入它。
这是什么systemctl status zfs-import-cache 好像,
zfs-import-cache.service - Import ZFS pools by cache file
Loaded: loaded (/usr/lib/systemd/system/zfs-import-cache.service; static)
Active: inactive (dead)
cat /etc/sysconfig/zfs
# ZoL userland configuration.
# Run `zfs mount -a` during system start?
ZFS_MOUNT='yes'
# Run `zfs unmount -a` during system stop?
ZFS_UNMOUNT='yes'
# Run `zfs …Run Code Online (Sandbox Code Playgroud) 我已经在新的 CentOS 7 机器上安装了 redis,但无法使用 systemctl 启动它。
它是这样安装的:
rpm -i http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
yum install redis
Run Code Online (Sandbox Code Playgroud)
尝试像这样启动它似乎默默地失败了(没有输出):
systemctl start redis-server # also tried redis-server.service
Run Code Online (Sandbox Code Playgroud)
以下是尝试连接时发生的情况:
redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>
Run Code Online (Sandbox Code Playgroud)
但是手动启动它是有效的:
[root@redis ~]# redis-server /etc/redis.conf
[root@redis ~]# redis-cli
127.0.0.1:6379>
Run Code Online (Sandbox Code Playgroud)
任何人都知道出了什么问题,或者如何调试?
更新:输出/var/log/redis/redis.log如下。顺便说一句,这是一个 512mb RAM VPS。
[1972] 29 Jul 18:52:16.258 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
[1972] 29 Jul 18:52:16.258 # Redis can't set maximum open files to …Run Code Online (Sandbox Code Playgroud) 每次重新启动服务器时,都会删除目录 /run/httpd。/run 是一个 tmpfs 文件系统,因此安装在 RAM 中。
/run/httpd 仅在安装期间创建。重新启动后启动 httpd 时,不会重新创建该目录。
服务器已安装 CentOS 7 和官方存储库 Apache 包(v. 2.4.6-18)。
Apache安装启动后,目录如下:
# ls -alR /run/httpd/
/run/httpd/:
total 8
drwx--x---. 3 root apache 120 Sep 30 08:39 .
drwxr-xr-x. 28 root root 1020 Sep 30 08:37 ..
-rw-r--r--. 1 root root 8 Sep 30 08:39 authdigest_shm.2953
drwx------. 2 apache apache 40 Jul 23 10:48 htcacheclean
-rw-r--r--. 1 root root 5 Sep 30 08:39 httpd.pid
srwx------. 1 apache root 0 Sep 30 08:39 wsgi.2953.0.1.sock …Run Code Online (Sandbox Code Playgroud) 我有一个带有 1 280GB 磁盘的 VM。出于某种原因,我的布局是:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 21G 30G 41% /
devtmpfs 5.8G 0 5.8G 0% /dev
tmpfs 5.8G 0 5.8G 0% /dev/shm
tmpfs 5.8G 8.5M 5.8G 1% /run
tmpfs 5.8G 0 5.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 224G 13G 212G 6% /home
/dev/sda1 497M 145M 352M 30% /boot
tmpfs 1.2G 0 1.2G 0% /run/user/1000
Run Code Online (Sandbox Code Playgroud)
运行 fdisk -l:
$ sudo fdisk -l
[sudo] password for admin:
Disk /dev/sda: 300.6 GB, 300647710720 bytes, …Run Code Online (Sandbox Code Playgroud) 我已经为它构建了一个应用程序和一个 systemd 单元。systemd 单元工作正常,但随着开发和生产环境的不同,我开始将配置移到环境变量中,但似乎无法让它们在 systemd 中工作。
我已经尝试过系统范围的环境变量,它们对操作系统可见,但对程序不可见,所以我开始考虑将它们构建到 systemd 单元中。
首先我尝试使用 EnvironmentFile
我创建了一个简单的环境文件
LCSQLH=localhost
LCSQLU=application
Run Code Online (Sandbox Code Playgroud)
在它作为/etc/lc.sh和
[Unit]
Description=Service for this app
[Service]
EnvironmentFile=/etc/lc.sh
ExecStart=/usr/bin/env python /opt/app/__init__.py
Run Code Online (Sandbox Code Playgroud)
做了systemctl --system daemon-reload但没有,我的应用程序出错:
Jan 27 14:24:59 machine.host env[630]: KeyError: 'LCSQLU'
我看到一些有:
EnvironmentFile=-/etc/lc.sh
我试过了……不……
所以我试着把它们单独放进去
[Service]
Environment="LCSQLH=localhost"
Environment="LCSQLU=application"
ExecStart=/usr/bin/env python /opt/app/__init__.py
Run Code Online (Sandbox Code Playgroud)
再一次,没有...
所以我听说了这样的想法,/etc/systemd/service_name.service.d所以我在那里放了一个 service.conf 和环境(与上面的格式相同)但没有......
我的应用程序无法访问这些环境变量。
如果我导出它们(在我的 shell 中手动或使用 /etc/profile.d/)并直接运行我的应用程序,它就可以工作,所以这些不是被设置而不是应用程序问题。
这是 Centos 7.3,我选择了环境变量而不是硬编码的配置,因为它可以在 linux 或 windows 上运行,所以不想将配置文件埋在 /etc/ 中