postgresql Mac OS X Snow Leopard 的默认 /etc/sysctl.conf 设置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9248105/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-20 23:38:21  来源:igfitidea点击:

Default /etc/sysctl.conf settings for Mac OS X Snow Leopard?

macospostgresqlsysctl

提问by Mur Quirk

I tried to install PostgreSQL 9.1.2 for Mac OS X 10.6 and it asked me to edit the sysctl.conf file inside the /etc/ directory, so it could use more of the shared memory PostgreSQL was asking for.

我尝试为 Mac OS X 10.6 安装 PostgreSQL 9.1.2,它要求我编辑 /etc/ 目录中的 sysctl.conf 文件,以便它可以使用 PostgreSQL 要求的更多共享内存。

I went ahead and edited the file, saved it, rebooted and then on the login screen I was asked to login as safe boot for some reason, I logged in and internet did not seem to work and the dock menu was laggy.

我继续编辑文件,保存它,重新启动,然后在登录屏幕上,出于某种原因,我被要求以安全启动方式登录,我登录后互联网似乎无法正常工作,并且停靠菜单滞后。

So it was pretty obvious this was happening because of the sysctl.conf file that I edited before the reboot, so I went back into the /etc directory and deleted the sysctl.conf file thinking it would auto-create a new sysctl.conf file with the default settings but that wasn't the case even after a reboot.

所以很明显这是因为我在重启前编辑了 sysctl.conf 文件,所以我回到 /etc 目录并删除了 sysctl.conf 文件,认为它会自动创建一个新的 sysctl.conf 文件使用默认设置,但即使在重新启动后情况也并非如此。

So now I'm pretty much left without a sysctl.conf file, I read the Mac Developer documentation for this file and it didn't say much. I know I probably shouldn't be messing with files that I don't have a clue about but I really wanted to get PostgreSQL working for my local Ruby on Rails development.

所以现在我几乎没有 sysctl.conf 文件,我阅读了这个文件的 Mac 开发人员文档,但它没有说太多。我知道我可能不应该弄乱我不知道的文件,但我真的想让 PostgreSQL 为我的本地 Ruby on Rails 开发工作。

Anything on this topic would be helpful.

关于这个主题的任何内容都会有所帮助。

采纳答案by Eelke

Mine contains the following:

我的包含以下内容:

kern.sysv.shmmax=134217728
kern.sysv.shmmin=1
kern.sysv.shmmni=256
kern.sysv.shmseg=64
kern.sysv.shmall=32768

I have Lion myself but I don't think there was anything else in it when I was using Snow Leopard.

我自己也有 Lion,但当我使用 Snow Leopard 时,我认为其中没有其他任何东西。

回答by James Allman

I have no /etc/sysctl.conffile on OS X 10.7.2 (Lion).

/etc/sysctl.conf在 OS X 10.7.2 (Lion) 上没有文件。



I suggest you save yourself a lot of headaches and install Postgres using the Homebrewpackage manager.

我建议您省去很多麻烦并使用Homebrew包管理器安装 Postgres 。

The steps, once XCode is installed, are:

安装 XCode 后的步骤是:

Install Homebrew

安装 Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Install Postgres

安装 Postgres

brew update; brew install postgres

Initialize Postgres

初始化 Postgres

initdb /usr/local/var/postgres

Set Postgres to run automatically

设置 Postgres 自动运行

mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.1.2/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist