我遵循此https://jsfiddle.net/yjkgdgad/在Ubuntu postgresql服务器上创建主从复制。
repmgr
和postgresql
的我的配置是:
Postgresql 9.5-:/opt/PostgreSQL/9.5/
repmgr-:/usr/lib/postgresql/9.5/bin/repmgr
repmgr.conf - :/etc/rep.conf
pg_config --pkglibdir => /usr/lib/postgresql/9.5/lib
ls /usr/lib/postgresql/9.5/lib | grep repmgr_funcs => repmgr_funcs.so
我收到了ERROR-:无法创建函数
repmgr_update_last_updated: ERROR: could not access file "$libdir/repmgr_funcs": No such file or directory
ERROR: Unable to create repmgr schema - see preceding error message(s); aborting
答案 0 :(得分:5)
如果您使用public partial class Form1 : Form
{
private readonly Person person;
public Form1()
{
InitializeComponent();
person = new Person()
{
Name = "joe",
Race = Race.Indian
};
textBox1.DataBindings.Clear();
textBox1.DataBindings.Add(nameof(textBox1.Text), person, nameof(person.Name));
comboBox1.DataSource = Enum.GetValues(typeof(Race));
comboBox1.DataBindings.Clear();
comboBox1.DataBindings.Add(nameof(comboBox1.SelectedItem), person, nameof(person.Race));
comboBox1.SelectedIndexChanged += ComboBox1_SelectedIndexChanged;
}
private void ComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//when selected index is changed, the data is lagging behind the selected item.
//eg: SelectedItem is already Chinese, but person.Race is still Indian
MessageBox.Show($"data {person.Race}, selected item {comboBox1.SelectedItem}");
}
private int count = 0;
private void button1_Click(object sender, EventArgs e)
{
person.Race =(Race)(((int)person.Race + 1) % Enum.GetValues(typeof(Race)).Length);
person.Name = person.Name + $"{count++}";
}
}
public enum Race
{
Indian,
Chinese,
Causacian,
Arabian,
Jewish,
SouthINdian,
}
public class Person: INotifyPropertyChanged
{
private Race _race;
private string _name;
public string Name
{
get
{
return _name;
}
set
{
_name = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Name)));
}
}
public Race Race
{
get
{
return _race;
}
set
{
_race = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs (nameof(Race)));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
ver。 4及以上,你需要改变repmgr
来自postgresql.conf
至shared_preload_libraries = 'repmgr_funcs'
以下是他们的升级说明
repmgr共享库已从repmgr_funcs重命名为 repmgr,意思是postgresql.conf中的shared_preload_libraries需要 更新为新名称:shared_preload_libraries ='repmgr'