我试图使用自动响应自动化mysql_secure_installation脚本.我的代码如下:
echo "& y y abc abc y y y y" | ./usr/bin/mysql_secure_installation
Run Code Online (Sandbox Code Playgroud)
我自动化的实际问题如下:
Enter current password for root (enter for none): <enter>
Set root password? [Y/n] y
New password: abc
Re-enter new password: abc
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Run Code Online (Sandbox Code Playgroud)
但它给了我一个错误"抱歉,你不能在这里使用空密码",但在屏幕上,我曾经按下第一个问题的返回键.
我是React JS的初学者,我想为我的仪表板开发基于路由器的反应导航.该模型如下:
我为尝试路由而创建的app.js代码如下:
import React from 'react'
import { render } from 'react-dom'
import { Router, Route, Link } from 'react-router'
import Login from './components/Login.js';
const App = React.createClass({
render() {
return (
<div>
<h1>App</h1>
<ul>
<li><Link to="/login">Login</Link></li>
<li><Link to="/inbox">Inbox</Link></li>
</ul>
{this.props.children}
</div>
)
}
})
render((
<li>
<Router>
<Route path="/" component={App}>
<Route path="login" component={Login} />
</Route>
</Router>
</li>
), document.getElementById('placeholder'))
Run Code Online (Sandbox Code Playgroud)
如何创建模型中显示的导航?
我打算使用supervisor运行多个进程,请在下面找到我的supervisord.conf文件:
[supervisord]
[program:bash]
command=xyz
stdout_logfile =/tmp/bash.log
redirect_stderr=true
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
Run Code Online (Sandbox Code Playgroud)
我希望将名为bash的进程的stdout重定向到supervisor控制台,以便在我启动supervisor时使用
/usr/bin/supervisord
Run Code Online (Sandbox Code Playgroud)
命令,我可以看到子进程日志.我怎样才能做到这一点 ?我尝试将syslog用于stdout_logfile属性但它不起作用.
我在 Centos7 上安装了 Docker,并将 selinux 设置为在主机上强制执行,并且 Docker 守护进程以 --selinux-enabled 标志启动。
当我尝试运行以下命令时
docker run -it -v /usr/local/xya/log:/usr/local/xya/log:z centos/systemd touch /usr/local/xya/log/test
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
docker: Error response from daemon: error setting label on mount source '/usr/local/xya/log': relabeling content in /usr is not allowed.
Run Code Online (Sandbox Code Playgroud)
根据一些文章(http://jaormx.github.io/2018/selinux-and-docker-notes/),“z ”标志应该使 /usr 可写;不确定我是否遗漏了一些东西。
Docker版本19.03.3,构建a872fc2f86 CentOS版本:CentOS Linux发行版7.5.1804
我正在使用nginx和Supervisor.我的supervisord.conf文件内容如下:
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
[program:nginx]
command=/usr/sbin/nginx -c /etc/nginx/nginx.conf
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
redirect_stderr=true
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
Run Code Online (Sandbox Code Playgroud)
在确保netstat -nltp表示所有端口都是免费的之后我启动了supervisord,但是请找到下面的nginx错误日志:
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:81 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:18081 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:18082 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:18083 failed (98: Address already in use)
2014/09/10 …
Run Code Online (Sandbox Code Playgroud) 我已经在ES6中使用react路由器实现了一个反应JS测试应用程序,但它似乎没有用.我的代码片段如下:
app.js
-------
import React from 'react';
import ReactDOM from 'react-dom';
import Routes from './routes';
ReactDOM.render(Routes, document.getElementById('react-container'));
routes.js
---------
import React from 'react';
import { DefaultRoute, Link, Route, RouteHandler,Router } from 'react-router';
import Page1 from './page1';
import Home from './home';
import { IndexRoute } from 'react-router';
let routes =
<Router>
<Route path="/" component={Home}>
<Route path="page1" component={ Page1 }/>
</Route>
</Router>
export default routes
home.js
-------
import React, { Component } from 'react';
import Header from './components/header';
export default class Home …
Run Code Online (Sandbox Code Playgroud) 我正在尝试为Couchbase创建一个docker镜像,我在CentOS镜像上的dockerfile出现以下错误.
# expose default port
EXPOSE 8091
ENV PATH $PATH:/opt/couchbase/bin
RUN cd /var/tmp &&\
wget http://packages.couchbase.com/releases/2.5.0/couchbase-server-enterprise_2.5.0_x86_64.rpm &&\
rpm -ivh couchbase-server-enterprise_2.5.0_x86_64.rpm &&\
chkconfig couchbase-server on &&\
service couchbase-server start
#add start script to the container
ADD start /start
#make the script executable
RUN chmod 0755 /start
EXPOSE 11211 11210 11209 4369 8092 18091 18092 11214 11215
#start mysql service and launch the command console
CMD ["/start"]
Run Code Online (Sandbox Code Playgroud)
在构建它时,我收到以下错误..
ulimit: open files: cannot modify limit: Operation not permitted
ulimit: max locked memory: cannot …
Run Code Online (Sandbox Code Playgroud) 最近我试图找到使用ELK堆栈的最佳Docker日志记录机制.我对公司在生产中使用的最佳工作流程有一些疑问.我们的系统有典型的软件堆栈,包括Tomcat,PostgreSQL,MongoDB,Nginx,RabbitMQ,Couchbase等.截至目前,我们的堆栈在CoreOS集群中运行.请在下面找到我的问题
这是一个主观问题,但我确信这是人们很久以前解决的问题,我并不热衷于重新发明轮子.
我创建了一个docker容器,并尝试在该容器的bash中ping通www.google.com,它可以工作。我也尝试从主机ping容器-它工作得很好。
但是,当我尝试从网络中的外部系统ping容器时,它给了我一个请求超时异常。
我打算在容器上安装tomcat Web服务器,并允许其他容器访问服务器中部署的应用程序。希望能有所帮助!
我将在Tomcat上运行的Web应用程序容器化并使用命令启动容器,
docker run -d -p 8080:8080 tveuser/tve-repository:tve-services
Run Code Online (Sandbox Code Playgroud)
我还使用以下命令在同一主机上运行PostgreSQL容器:
docker run -d -p 80:80 -p 5432:5432 tveuser/tve-repository:tve-postgresql
Run Code Online (Sandbox Code Playgroud)
我通过使用phpPgAdmin验证PostgreSQL正在运行,但无法通过tomcat连接到它.'docker ps'也告诉我两个容器都已启动并运行.
我通过tomcat context.xml将Web应用程序与数据库连接,后者的条目类似于
<Parameter name="abc.connection.url" value="jdbc:postgresql://1.2.3.4:5432/dbname" />
Run Code Online (Sandbox Code Playgroud)
其中1.2.3.4是容器正在运行的docker主机Ip.但是当我运行tomcat容器时出现以下错误:
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:225)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:136)
...............
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
Run Code Online (Sandbox Code Playgroud)
任何帮助赞赏.
docker ×5
linux ×2
react-router ×2
reactjs ×2
supervisord ×2
centos ×1
containers ×1
ecmascript-6 ×1
lumberjack ×1
mysql ×1
nav ×1
networking ×1
nginx ×1
ping ×1
port ×1
postgresql ×1
rsyslog ×1
selinux ×1
shell ×1
tomcat ×1
ulimit ×1