解决docker容器中不能使用systemctl的问题
具体问题如下
systemctl start mysql
System has not been booted with systemd as init system (PID 1). Can't operate
解决方案
docker run -it --privileged=true -h node02 --ip 172.18.0.2 --name node02 ubuntu:v1 /usr/sbin/init
创建容器时给予容器特权,并在init目录下运行
我是在容器中启动mysql是出现的这个问题
此类问题大多都是权限不够造成的,只需给足权限即可