在大陆地区的云上部署 Discourse


(阳天) #42

谢谢 下一次我还会继续折腾 这是去年的事了


#43
[root@localhost discourse]# ./launcher bootstrap app
which: no docker.io in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin)
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2015-04-17T15:56:49.053579 #37]  INFO -- : Loading --stdin
I, [2015-04-17T15:56:49.057617 #37]  INFO -- : > mkdir -p /shared/postgres_run
I, [2015-04-17T15:56:49.062057 #37]  INFO -- : 
I, [2015-04-17T15:56:49.062416 #37]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2015-04-17T15:56:49.066761 #37]  INFO -- : 
I, [2015-04-17T15:56:49.067090 #37]  INFO -- : > chmod 775 /shared/postgres_run
I, [2015-04-17T15:56:49.071086 #37]  INFO -- : 
I, [2015-04-17T15:56:49.071504 #37]  INFO -- : > rm -fr /var/run/postgresql
I, [2015-04-17T15:56:49.074590 #37]  INFO -- : 
I, [2015-04-17T15:56:49.074915 #37]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2015-04-17T15:56:49.079182 #37]  INFO -- : 
I, [2015-04-17T15:56:49.079551 #37]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2015/04/17 15:56:49 socat[45] E connect(4, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2015-04-17T15:56:49.114644 #37]  INFO -- : 
I, [2015-04-17T15:56:49.115022 #37]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2015-04-17T15:56:49.117258 #37]  INFO -- : 
I, [2015-04-17T15:56:49.117545 #37]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2015-04-17T15:56:49.120965 #37]  INFO -- : 
I, [2015-04-17T15:56:49.121246 #37]  INFO -- : > mkdir -p /shared/postgres_run/9.3-main.pg_stat_tmp
I, [2015-04-17T15:56:49.123241 #37]  INFO -- : 
I, [2015-04-17T15:56:49.123534 #37]  INFO -- : > chown postgres:postgres /shared/postgres_run/9.3-main.pg_stat_tmp
I, [2015-04-17T15:56:49.126036 #37]  INFO -- : 
I, [2015-04-17T15:56:49.130614 #37]  INFO -- : File > /etc/service/postgres/run  chmod: +x
I, [2015-04-17T15:56:49.135719 #37]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x
I, [2015-04-17T15:56:49.139064 #37]  INFO -- : File > /root/upgrade_postgres  chmod: +x
I, [2015-04-17T15:56:49.139924 #37]  INFO -- : > chown -R root /var/lib/postgresql/9.3/main
I, [2015-04-17T15:56:49.163808 #37]  INFO -- : 
I, [2015-04-17T15:56:49.163921 #37]  INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/9.3/bin/initdb -D /shared/postgres_data || exit 0
I, [2015-04-17T15:56:49.165685 #37]  INFO -- : 
I, [2015-04-17T15:56:49.165860 #37]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2015-04-17T15:56:49.169166 #37]  INFO -- : 
I, [2015-04-17T15:56:49.169244 #37]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2015-04-17T15:56:49.170262 #37]  INFO -- : 
I, [2015-04-17T15:56:49.170326 #37]  INFO -- : > /root/upgrade_postgres
cat: /shared/postgres_data/PG_VERSION: No such file or directory
/root/upgrade_postgres: line 2: [: 9.2: unary operator expected
I, [2015-04-17T15:56:49.190337 #37]  INFO -- : 
I, [2015-04-17T15:56:49.190664 #37]  INFO -- : > rm /root/upgrade_postgres
I, [2015-04-17T15:56:49.192848 #37]  INFO -- : 
I, [2015-04-17T15:56:49.195514 #37]  INFO -- : Replacing data_directory = '/var/lib/postgresql/9.3/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.196745 #37]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.201364 #37]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.201918 #37]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.202488 #37]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.203889 #37]  INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.204280 #37]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2015-04-17T15:56:49.214652 #37]  INFO -- : 
I, [2015-04-17T15:56:49.214863 #37]  INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = 4 in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.215326 #37]  INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = hot_standby in /etc/postgresql/9.3/main/postgresql.conf
I, [2015-04-17T15:56:49.217229 #37]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/9.3/main/pg_hba.conf
I, [2015-04-17T15:56:49.217559 #37]  INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/9.3/main/pg_hba.conf
I, [2015-04-17T15:56:49.218090 #37]  INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main
I, [2015-04-17T15:56:49.229912 #37]  INFO -- : > sleep 5
2015-04-17 15:56:49 UTC [66-1] FATAL:  data directory "/shared/postgres_data" has wrong ownership
2015-04-17 15:56:49 UTC [66-2] HINT:  The server must be started by the user that owns the data directory.
I, [2015-04-17T15:56:54.239352 #37]  INFO -- : 
I, [2015-04-17T15:56:54.240217 #37]  INFO -- : > su postgres -c 'createdb discourse' || true
createdb: could not connect to database template1: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2015-04-17T15:56:54.385584 #37]  INFO -- : 
I, [2015-04-17T15:56:54.386100 #37]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2015-04-17T15:56:54.445961 #37]  INFO -- : 
I, [2015-04-17T15:56:54.446428 #37]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2015-04-17T15:56:54.487488 #37]  INFO -- : 
I, [2015-04-17T15:56:54.488000 #37]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?


FAILED
--------------------
RuntimeError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 92 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
I, [2015-04-17T15:56:54.525465 #37]  INFO -- : 
I, [2015-04-17T15:56:54.525702 #37]  INFO -- : Terminating async processes
c24cec97a128f4cecb149a71bbb778e4ac8e651a74987bce48c33d6c2637ab78
FAILED TO BOOTSTRAP

求指导,这是什么问题呢?


#44

请问什么是淘宝的镜像,淘宝网镜像?去淘宝买镜像?怎么理解的啊!

Docker运行环境(Ubuntu 64位)

Ubuntu 14.04 64位 来源:杭州云集通信科技有限公司
集成软件:Ubuntu 14.04 64位、Docker1.2版本

意思选择对应的镜像?


(Erick Guan) #45

http://ruby.taobao.org/


#46

:cry:,我是Centos7,不会翻墙,不会用ruby.taobao.org,我是在本地用 Vagrant 测试的,这一步 [root@localhost discourse]# ./launcher bootstrap app 一直错误,可以指点一下吗?


#47

怎么开 vpn 啊?


(Erick Guan) #48

你按照下面的说明添加了模板了么?


#49

谢谢,添加了,换了系统就好了。


#50

./launcher ssh app 让我输密码,默认密码是什么呀?


(Erick Guan) #51

你如果设置了主机的 ssh 私钥,就可以不要密码登录,否则要在配置文件的最后的部分解除注释后设置。


(凉风微软) #52

不错。
请教一下:
aliyun ubuntu docker server.
安装discourse,发邮件时报错
ERROR: Servname not supported for ai_socktype
Ensure that the host ‘smtp.exmail.qq.com’ exists
是什么原因。


(Erick Guan) #53

端口正确么?你的配置选项是什么?


(周珺) #54

端口587?阿西吧凑字数。。。


(onmi) #55

RuntimeError: cd /var/www/discourse && gem update bundler failed with return #<Process::Status: pid 350 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn’
exec failed with the params {“cd”=>"$home", “hook”=>“web”, “cmd”=>[“gem update bundler”, “chown -R discourse $home”]}
bf596e0ba8f8140bcb0ac8459ba466c98ffbc644a2e2968a38d0a8dfbb603204
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

怎么解决呀 这些错误


(onmi) #56
Error response from daemon: Cannot start container 2ef255298cfbf4340e43c101467b9a996806f55c8c822de05e417ab81bec2c7a: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
root@iZ25pamnfsuZ:/var/docker# ./launcher start app

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: Cannot start container app: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
Error: failed to start containers: [app]

此错误 可以怎么解决呢


(Erick Guan) #57

你要贴出完整日志,向上滚屏到最前。


(hxygsh) #60

按照教程 和 本文修改了配置 安装成功了

不过,DISCOURSE_HOSTNAME 我因为没有域名就设置了localhost 绑定外网IP 浏览器显示无法打开页面啊,请各位多指教,谢啦!
用的ucloud 的云主机 端口好像默认80 123.59.142.41:80 也不行

低级错误:原来防火墙80端口没绑定,多谢论坛里指导。


(Erick Guan) #61

尝试设置:123.59.142.41


(hxygsh) #62

邮箱用的是阿里云的,怎么也发不出邮件,设置如图,看了论坛有人用mxhichina 设置成功了,请帮助指导一下,多谢啦

app.yml设置如下图:

discourse 邮箱测试界面如下图:


(Erick Guan) #63

我没用过这邮件服务,也不知道有啥错误,这你只能看前人经验了…